How to configure postgres Timezone?

How to configure postgres Timezone?


     In PostgreSQL, the timezone configuration is essential for handling date and time values accurately, especially when dealing with data from different time zones. The system time zone of the operating system can also influence PostgreSQL's behaviour since, PostgreSQL queries the system for the local time zone if not explicitly configured.

      If you want to explicitly configure timezone for the PostgreSQL server, We can set the timezone either of the below methods in appropriate cases.
Pro-tip :
you can find your  appropriate timezone value from the list of time zones by executing the below query.
  1.     SELECT * FROM pg_timezone_names;
Check current Timezone by
  1.    SHOW TIMEZONE;

Case 1 : Configuring Timezone for the PostgreSQL server globally, persistent over multiple sessions.
  1. Navigate to <product_installation_directory> \ pgsql \ ext_conf folder.
  2. Add/Edit the below entry in 00framework_ext.conf file.
timezone='Asia/Kolkata'
log_timezone='Asia/Kolkata'
      3. Restart the PostgreSQL server.

Case 2 : Configuring timezone only to specific databases, persistent over multiple sessions.
  1. Login into PostgreSQL server in command prompt
  2. Execute the below SQL query.
ALTER DATABASE servicedesk SET TIMEZONE TO 'America/New_York
      3. Restart the PostgreSQL server.

Case 3 : Testing timezone configuration, (persist only in current session)
  1. Login into PostgreSQL server in command prompt.
  2. Execute the below SQL query.
SET TIMEZONE to 'America/New_York';

This case, will be useful for testing the appropriate timezone before configuring your database to switch to that timezone.


If you face any issues in configuring the Timezone, Reach our Support Team with the below information.
  1. Operating system
  2. Steps followed to set the Timezone.
  3. PostgreSQL configuration files such as,
    1. <installation_folder> \ pgsql \ data \ postgresql.conf
    2. <installation_folder> \ pgsql \ ext_conf folder
    3. <installation_folder> \ ext_conf \ 00framework_ext.conf file
  4. PostgreSQL logs generated when setting the timezone, which can be found under " <installation_folder> \ pgsql \ data \ pg_log folder"
      

                  New to ADSelfService Plus?

                    • Related Articles

                    • How to Connect External Postgres

                      To install an external PostgreSQL server, ensure the PostgreSQL version matches the inbuilt PostgreSQL version series of the ServiceDesk Plus application. For example: If ServiceDesk Plus version is 14010 with PostgreSQL version 10.21, install an ...
                    • Query Executor Tool for PostGres

                      This tool is designed to execute queries in the customer environment by connecting the database by reading the database configuration file. We need to enter the query that we require to execute in queryToExecute.txt file. We can enter multiple ...
                    • Database migration from MySQL to Postgres/MSSQL in SCP 8.1

                      We no longer support the use of MYSQL as database in SupportCenter Plus. Hence, we request our users to migrate to Postgres (which is in-built) or Microsoft SQL. Please follow the below steps to carry out the database migration: 1. Shutdown the ...
                    • Remote read only access to database for Postgres customers

                      Frequently customers want to connect some reporting / dashboard application like PowerBI or Tableau with our Postgres database server. By default, the bundled Postgres is configured to only listen to the local machine. We can configure to allow ...
                    • Query Executor Tool for Postgres

                      Overview: A query executor tool for PostgreSQL that allows for query execution without a direct database connection enhances security and flexibility while collaborating on query testing without the need for each team member to have direct database ...