select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / CLIENT CONNECTION DEFAULTS

Sets the locale to use for formatting dates and times, for example with the to_char family of functions.

Type
string
Context
user
Measured default
C
Unit
Metadata snapshot
18

Definition PG 18 manual

Sets the locale to use for formatting dates and times, for example with the to_char family of functions. Acceptable values are system-dependent; see Section 23.1 for more information. If this variable is set to the empty string (which is the default) then the value is inherited from the execution environment of the server in a system-dependent way.

Measured default history
Version intervalDefault
9.0 – 19C
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

lc_time sets the locale for formatting date and time values. An empty string means use the operating system setting. It controls locale-sensitive names and layouts used by formatting functions; DateStyle and TimeZone remain separate controls.

lc_time is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.

It changes representation, parsing, or locale behavior at the client boundary rather than physical storage. Coordinate it with the other locale and formatting settings and with driver-native binary or typed protocols.

Operational considerations

Changing lc_time in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.

Assuming a presentation setting changes stored values or server-side type semantics.

Changing a role or database default without testing text-parsing clients, exports, and pooled sessions.

Changing lc_time globally without a rollback plan and a client or operational compatibility test.

Workload guidance

OLAP: Pin lc_time for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.

OLTP: Treat lc_time as an application contract, not a performance knob. Standardize it per role or connection pool and keep wire formats explicit where clients parse text.

SMALL: Keep the upstream or locale-derived value unless a client requires another one. A smaller server gains no capacity from changing lc_time.

Version history 4
  1. PG 17 → 18changed
  2. PG 16 → 17changed
  3. PG 13 → 14changed
  4. PG 9.5 → 9.6changed

Related entries

Further reading

Definition snapshot: english-manuals:17486f36a80d00c8c672469e52c… · English manual source