{"Entry":{"collection":"guc","key":"IntervalStyle","name":"IntervalStyle","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Client Connection Defaults / Locale and Formatting","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"8.3","status":"added","to":"8.4"},{"documentation_changed":true,"fields":{},"from":"9.6","status":"changed","to":"10"}],"content_hash":"ce7bd4588c89d4ea033dec304623332e15ebcef697fb775e32ffd4e23bf515b1","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"postgres"}],"editorial":{"advice":{"olap":"Pin IntervalStyle for export, reporting, and reproducible analytical jobs; prefer explicit SQL formatting when a file or API has a durable schema.","oltp":"Treat IntervalStyle 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 IntervalStyle."},"mechanism":["IntervalStyle sets the display format for interval values. Its four modes target PostgreSQL compatibility, verbose output, SQL-standard literals, or ISO 8601; it can also change how ambiguous interval input is read.","IntervalStyle 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."],"pitfalls":["Changing IntervalStyle 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 IntervalStyle globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: IntervalStyle","url":"https://www.postgresql.org/docs/19/runtime-config-client.html#GUC-INTERVALSTYLE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["DateStyle","TimeZone","lc_time","timezone_abbreviations","log_timezone"],"summary":"IntervalStyle is the PostgreSQL setting that defines the display format for interval values."},"enumvals":[],"first_version":"8.4","group":"Client Connection Defaults","group_slug":"client","imported_at":"2026-09-27T17:57:30.715315+08:00","intro_commit":{},"key":"intervalstyle","last_version":"20","max_val":"","min_val":"","name":"IntervalStyle","position":1,"present_in":["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 display format for interval values.","short_desc_zh":"","source_rev":"english-manuals:66c8032d933582b6875c6c55e3bb95bf1e041f11195a91f30b738871936af885","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"IntervalStyle","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"IntervalStyle","SourceRevision":"english-manuals:66c8032d933582b6875c6c55e3bb95bf1e041f11195a91f30b738871936af885","Facts":{"boot_val":"postgres","category":"Client Connection Defaults / Locale and Formatting","context":"user","description":"Sets the display format for interval values. The value sql_standard will produce output matching SQL standard interval literals. The value postgres (which is the default) will produce output matching PostgreSQL releases prior to 8.4 when the DateStyle parameter was set to ISO. The value postgres_verbose will produce output matching PostgreSQL releases prior to 8.4 when the DateStyle parameter was set to non-ISO output. The value iso_8601 will produce output matching the time interval “format with designators” defined in section 4.4.3.2 of ISO 8601. The IntervalStyle parameter also affects the interpretation of ambiguous interval input. See Section 8.5.4 for more information.","doc":{"anchor":"GUC-INTERVALSTYLE","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"},"documented":true,"enumvals":["postgres","postgres_verbose","sql_standard","iso_8601"],"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"IntervalStyle","short_desc":"Sets the display format for interval values.","source":"pg-settings-source-snapshot","unit":null,"vartype":"enum"},"ManualEvidence":{"doc":{"anchor":"GUC-INTERVALSTYLE","file":"runtime-config-client.html","lang":"en","sha256":"6be6cc70f29eca4695dc43b2b2b94c75b7e0eaaa2c00273d7a98488917a7edb7","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"IntervalStyle","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"IntervalStyle","Summary":"","BodyHTML":"\u003cp\u003e设置时间间隔值的显示格式。值\u003ccode\u003esql_standard\u003c/code\u003e会生成符合SQL标准时间间隔字面量的输出。值\u003ccode\u003epostgres\u003c/code\u003e（默认值）的输出与\u003cspan\u003ePostgreSQL\u003c/span\u003e 8.4 之前版本中\u003ca href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\" rel=\"nofollow\"\u003eDateStyle\u003c/a\u003e设为\u003ccode\u003eISO\u003c/code\u003e时的输出一致。值\u003ccode\u003epostgres_verbose\u003c/code\u003e的输出与\u003cspan\u003ePostgreSQL\u003c/span\u003e 8.4 之前版本中\u003ccode\u003eDateStyle\u003c/code\u003e设为非\u003ccode\u003eISO\u003c/code\u003e输出时的输出一致。值\u003ccode\u003eiso_8601\u003c/code\u003e会生成符合 ISO 8601 第 4.4.3.2 节定义的时间间隔\u003cspan\u003e“\u003cspan\u003e带标志符格式\u003c/span\u003e”\u003c/span\u003e的输出。\u003c/p\u003e\u003cp\u003e\u003ccode\u003eIntervalStyle\u003c/code\u003e参数也会影响对有歧义的时间间隔输入的解释。详见\u003ca href=\"/docs/18/datatype-datetime.html#DATATYPE-INTERVAL-INPUT\" rel=\"nofollow\"\u003e第 8.5.4 节\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"4f319afc5b11f566d5e0f5f8a052b6f85970431c6058e71d289b5b947f4b703b","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置时间间隔值的显示格式。值\u003ccode class=\"literal\"\u003esql_standard\u003c/code\u003e会生成符合SQL标准时间间隔字面量的输出。值\u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e（默认值）的输出与\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.4 之前版本中\u003ca href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\"\u003eDateStyle\u003c/a\u003e设为\u003ccode class=\"literal\"\u003eISO\u003c/code\u003e时的输出一致。值\u003ccode class=\"literal\"\u003epostgres_verbose\u003c/code\u003e的输出与\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.4 之前版本中\u003ccode class=\"varname\"\u003eDateStyle\u003c/code\u003e设为非\u003ccode class=\"literal\"\u003eISO\u003c/code\u003e输出时的输出一致。值\u003ccode class=\"literal\"\u003eiso_8601\u003c/code\u003e会生成符合 ISO 8601 第 4.4.3.2 节定义的时间间隔\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e带标志符格式\u003c/span\u003e”\u003c/span\u003e的输出。\u003c/p\u003e\u003cp\u003e\u003ccode class=\"varname\"\u003eIntervalStyle\u003c/code\u003e参数也会影响对有歧义的时间间隔输入的解释。详见\u003ca href=\"/docs/18/datatype-datetime.html#DATATYPE-INTERVAL-INPUT\" title=\"8.5.4. 间隔输入\"\u003e第 8.5.4 节\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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}
