{"Entry":{"collection":"guc","key":"lc_messages","name":"lc_messages","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Locale and Formatting","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":true,"fields":{},"from":"8.0","status":"changed","to":"8.1"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.2","status":"changed","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"9.5","status":"changed","to":"9.6"},{"documentation_changed":true,"fields":{},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{},"from":"14","status":"changed","to":"15"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"extra_desc":{"from":null,"to":"An empty string means use the operating system setting."}},"from":"17","status":"changed","to":"18"}],"content_hash":"9cc786b7513efda51dd4bdde7db27abfa46322ee324add801c7e4d66ab4f21e7","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"Empty string"}],"editorial":{"advice":{"olap":"Pin lc_messages for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.","oltp":"Treat lc_messages 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_messages."},"mechanism":["lc_messages sets the language in which messages are displayed. An empty string means use the operating system setting. The accepted locale names and available translations are operating-system and build dependent; an empty value inherits the server environment.","lc_messages is a SUPERUSER-context setting. Superuser or a role granted the appropriate SET privilege 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."],"pitfalls":["Changing lc_messages 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_messages globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: lc_messages","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-LC-MESSAGES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["client_encoding","lc_monetary","lc_numeric","lc_time","default_text_search_config"],"summary":"lc_messages is the PostgreSQL setting that defines the language in which messages are displayed."},"enumvals":[],"first_version":"7.4","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:31.472229+08:00","intro_commit":{},"key":"lc_messages","last_version":"20","max_val":"","min_val":"","name":"lc_messages","position":208,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Sets the language in which messages are displayed.","short_desc_zh":"","source_rev":"english-manuals:4c4ae9d053444b52486e56412cfdf51701d935207eede387e063b2324aa3c020","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"lc_messages","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"lc_messages","SourceRevision":"english-manuals:4c4ae9d053444b52486e56412cfdf51701d935207eede387e063b2324aa3c020","Facts":{"boot_val":"","category":"Client Connection Defaults / Locale and Formatting","context":"superuser","description":"Sets the language in which messages are displayed. 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. On some systems, this locale category does not exist. Setting this variable will still work, but there will be no effect. Also, there is a chance that no translated messages for the desired language exist. In that case you will continue to see the English messages. Only superusers and users with the appropriate SET privilege can change this setting.","doc":{"anchor":"GUC-LC-MESSAGES","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"An empty string means use the operating system setting.","lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"lc_messages","short_desc":"Sets the language in which messages are displayed.","source":"pg-settings-source-snapshot","unit":null,"vartype":"string"},"ManualEvidence":{"doc":{"anchor":"GUC-LC-MESSAGES","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"lc_messages","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"lc_messages","Summary":"","BodyHTML":"\u003cp\u003e设置消息显示的语言。可接受的值是系统相关的；详见\u003ca href=\"/docs/18/locale.html\" rel=\"nofollow\"\u003e第 23.1 节\u003c/a\u003e。如果这个变量被设置为空字符串（默认），那么该值将以一种系统相关的方式从服务器的执行环境中继承。\u003c/p\u003e\u003cp\u003e在一些系统上，这个区域设置类别并不存在。仍然可以设置这个变量，只是不会有任何效果。同样，所期望语言的翻译消息也可能不存在。在这种情况下，你将仍然继续看到英文消息。\u003c/p\u003e\u003cp\u003e只有超级用户和具有适当\u003ccode\u003eSET\u003c/code\u003e权限的用户才能更改此设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"be404746c68ff92ec0cdc95f95b3ffa85274ae444d8ca378980298553851d488","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置消息显示的语言。可接受的值是系统相关的；详见\u003ca href=\"/docs/18/locale.html\" title=\"23.1. 区域设置支持\"\u003e第 23.1 节\u003c/a\u003e。如果这个变量被设置为空字符串（默认），那么该值将以一种系统相关的方式从服务器的执行环境中继承。\u003c/p\u003e\u003cp\u003e在一些系统上，这个区域设置类别并不存在。仍然可以设置这个变量，只是不会有任何效果。同样，所期望语言的翻译消息也可能不存在。在这种情况下，你将仍然继续看到英文消息。\u003c/p\u003e\u003cp\u003e只有超级用户和具有适当\u003ccode class=\"literal\"\u003eSET\u003c/code\u003e权限的用户才能更改此设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
