lc_monetary
Read PG 18 manual ↗Sets the locale to use for formatting monetary amounts, 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 monetary amounts, 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 interval | Default |
|---|---|
| 9.0 – 19 | C |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
lc_monetary sets the locale for formatting monetary amounts. An empty string means use the operating system setting. It affects monetary formatting functions such as to_char, not the numeric value stored in a money or numeric column.
lc_monetary 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_monetary 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_monetary globally without a rollback plan and a client or operational compatibility test.
Workload guidance
OLAP: Pin lc_monetary for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.
OLTP: Treat lc_monetary 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_monetary.
Version history 4
- PG 17 → 18changed
- PG 16 → 17changed
- PG 13 → 14changed
- PG 9.5 → 9.6changed
Related entries
Further reading
Definition snapshot: english-manuals:65b54d751da4c7f3c42ab59f499… · English manual source