{"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"}],"derived_content_hash":"b36ff1b5a7c5d976997f4c1663b403dd826a9186d7e87ad8fc6ad5cfbc37a6b4","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"],"repair_provenance":{"original_source_revision":"english-manuals:66c8032d933582b6875c6c55e3bb95bf1e041f11195a91f30b738871936af885","receipt_sha256":"74771cbfe099fe37137c77c2aad0e6c827b0889806a7078133cc17b25908b4a5","repair":"wiki-repair-20261023"},"short_desc":"Sets the display format for interval values.","short_desc_zh":"","source_rev":"wiki-repair-20261023:349e9c3d1a967fce425e1207daf2b06f7327147f3b7b8f12c4d47cc4212b9697","unit":"","vartype":"enum"}},"Definition":{"Collection":"guc","Key":"IntervalStyle","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"IntervalStyle","SourceRevision":"wiki-repair-20261023:349e9c3d1a967fce425e1207daf2b06f7327147f3b7b8f12c4d47cc4212b9697","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.","description_zh":"设置时间间隔值的显示格式。值 sql_standard 会生成符合 SQL 标准时间间隔字面量的输出。值 postgres（默认值）的输出与 PostgreSQL 8.4 之前版本中 DateStyle 设为 ISO 时的输出一致。值 postgres_verbose 的输出与 PostgreSQL 8.4 之前版本中 DateStyle 设为非 ISO 输出时的输出一致。值 iso_8601 会生成符合 ISO 8601 第 4.4.3.2 节定义的时间间隔“带标志符格式”的输出。 IntervalStyle 参数也会影响对有歧义的时间间隔输入的解释。详见第 8.5.4 节。","description_zh_html":"\u003cp\u003e\n        设置时间间隔值的显示格式。值 \u003ccode class=\"literal\"\u003esql_standard\u003c/code\u003e 会生成符合 \u003cacronym class=\"acronym\"\u003eSQL\u003c/acronym\u003e 标准时间间隔字面量的输出。值 \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e（默认值）的输出与 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.4 之前版本中 \u003ca class=\"xref\" href=\"/zh/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的输出。\n       \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"varname\"\u003eIntervalStyle\u003c/code\u003e 参数也会影响对有歧义的时间间隔输入的解释。详见\u003ca class=\"xref\" href=\"/zh/docs/18/datatype-datetime.html#DATATYPE-INTERVAL-INPUT\" title=\"8.5.4. 间隔输入\"\u003e第 8.5.4 节\u003c/a\u003e。\n       \u003c/p\u003e","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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-client.html","sha256":"1882f8fd5576909c4fcc44af53077378871e05f5be67723f20fe300273024767"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"enum","zh_from":"same-version-pgdoc"},"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":"center","Version":"18","Locale":"en","Title":"IntervalStyle","Summary":"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.","BodyHTML":"\u003cp\u003eSets 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.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:349e9c3d1a967fce425e1207daf2b06f7327147f3b7b8f12c4d47cc4212b9697","ContentHash":"81e0f4a8e595f06696ee3827db8b28e1a1fed504da0de52804bd8f12edddfdd7","Payload":{"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."}},"RequestedLocale":"en","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}
