Return a List of Timezones Supported by PostgreSQL

When working with PostgreSQL, you may occasionally find yourself in the situation where you need a list of timezones that Postgres recognises.

For example, you could be trying to set the timezone for your current session, or you could be using one of the datetime functions that allow you to manipulate the timezone.

Below are two views and two functions that return a list of timezones.

Continue reading

How clock_timestamp() Works in PostgreSQL

In PostgreSQL, clock_timestamp() is a non-SQL-standard time function that returns the current date and time.

An important consideration of this function is that its result changes throughout the execution of a statement. Therefore, you could get a different result in different parts of the statement if you call the function multiple times within a single statement.

Continue reading