Updated on 2025-08-25 GMT+08:00

Locale and Formatting

This section describes parameters related to time format settings.

DateStyle

Definition: Sets the display format for date and time values, as well as the rules for interpreting ambiguous date input values.

This variable consists of two independent components: output format declarations (ISO, Postgres, SQL, German) and the order of day/month/year for input and output (DMY, MDY, YMD). These can be set independently or together. Keywords Euro and European are equivalent to DMY. Keywords US, NonEuro, and NonEuropean are equivalent to MDY.

Range: String

Default Value: ISO, MDY

gs_initdb initializes this parameter to match the lc_time value.

Setting Suggestions: The ISO format is recommended. Postgres, SQL, and German use abbreviated letters to denote time zones, such as EST, WST, and CST.

IntervalStyle

Definition: Sets the display format for interval values.

Range: enumerated values

  • sql_standard generates output compliant with the SQL standard.
  • postgres produces output compatible with PostgreSQL 8.4 when the DateStyle parameter is set to ISO.
  • postgres_verbose yields output aligned with PostgreSQL 8.4 when DateStyle is set to non_ISO.
  • iso_8601 creates output conforming to the format and designator defined in ISO 8601.
  • oracle outputs results corresponding to the numtodsinterval function in Oracle databases. Refer to numtodsinterval for details.

The IntervalStyle parameter also influences the interpretation of ambiguous interval inputs.

Default Value: postgres

TimeZone

Definition: Defines the time zone used for displaying and interpreting timestamp values.

Range: String

Default Value: GMT

timezone_abbreviations

Definition: Configures the time zone abbreviations recognized by the server.

Range: String

Default Value: Default

Default indicates common time zone abbreviations. Others like Australia and India are used for defining specific installations.

extra_float_digits

Definition: Adjusts the number of digits displayed for floating-point values, including float4, float8, and geometric data types. The parameter value is added to the standard number of data bits (FLT_DIG or DBL_DIG as appropriate).

Range: an integer ranging from –15 to 3

  • Setting it to 3 includes some significant data bits, which is particularly useful for dumping floating-point data that needs precise restoration.
  • Setting it to a negative discards insignificant data bits.

Default Value: 0

client_encoding

Definition: Sets the character encoding type for the client.

Set it based on frontend service requirements. Keeping the client and server encodings consistent improves efficiency.

Range: All character encoding types compatible with PostgreSQL. UTF8 indicates the database's character encoding type.

  • Run the locale -a command to view the locales and corresponding encoding formats supported by the current system and configure accordingly.
  • By default, gs_initdb initializes this parameter based on the current system environment. Run the locale command to check the current configuration.
  • You are advised to keep the default value. Do not modify the client_encoding parameter directly in postgresql.conf using tools like gs_guc, as changes will not take effect to maintain consistent internal communication encoding across the cluster.

Default Value: UTF8

Recommended Value: SQL_ASCII or UTF8

lc_monetary

Definition: Sets the display format for monetary values, affecting outputs of functions like to_char. Acceptable values depend on the system.

Range: String

  • Run the locale -a command to view the locales and corresponding encoding formats supported by the current system and configure accordingly.
  • By default, gs_initdb initializes this parameter based on the current system environment. Run the locale command to check the current configuration.

Default Value: en_US.UTF-8

lc_numeric

Definition: Sets the display format for numeric values, affecting outputs of functions like to_char. Acceptable values depend on the system.

Range: String

  • Run the locale -a command to view the locales and corresponding encoding formats supported by the current system and configure accordingly.
  • By default, gs_initdb initializes this parameter based on the current system environment. Run the locale command to check the current configuration.

Default Value: en_US.UTF-8

lc_time

Definition: Sets the display format for time and locales, affecting outputs of functions like to_char. Acceptable values depend on the system.

Range: String

  • Run the locale -a command to view the locales and corresponding encoding formats supported by the current system and configure accordingly.
  • By default, gs_initdb initializes this parameter based on the current system environment. Run the locale command to check the current configuration.

Default Value: en_US.UTF-8