mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Add a new GUC variable called "IntervalStyle" that decouples interval output
from DateStyle, and create a new interval style that produces output matching the SQL standard (at least for interval values that fall within the standard's restrictions). IntervalStyle is also used to resolve the conflict between the standard and traditional Postgres rules for interpreting negative interval input. Ron Mayer
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.475 2008/10/06 13:05:36 mha Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.476 2008/11/09 00:28:35 tgl Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@ -213,6 +213,13 @@ static const struct config_enum_entry server_message_level_options[] = {
|
||||
{NULL, 0, false}
|
||||
};
|
||||
|
||||
static const struct config_enum_entry intervalstyle_options[] = {
|
||||
{"postgres", INTSTYLE_POSTGRES, false},
|
||||
{"postgres_verbose", INTSTYLE_POSTGRES_VERBOSE, false},
|
||||
{"sql_standard", INTSTYLE_SQL_STANDARD, false},
|
||||
{NULL, 0, false}
|
||||
};
|
||||
|
||||
static const struct config_enum_entry log_error_verbosity_options[] = {
|
||||
{"terse", PGERROR_TERSE, false},
|
||||
{"default", PGERROR_DEFAULT, false},
|
||||
@ -2519,6 +2526,16 @@ static struct config_enum ConfigureNamesEnum[] =
|
||||
XACT_READ_COMMITTED, isolation_level_options, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"IntervalStyle", PGC_USERSET, CLIENT_CONN_LOCALE,
|
||||
gettext_noop("Sets the display format for interval values."),
|
||||
NULL,
|
||||
GUC_REPORT
|
||||
},
|
||||
&IntervalStyle,
|
||||
INTSTYLE_POSTGRES, intervalstyle_options, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"log_error_verbosity", PGC_SUSET, LOGGING_WHEN,
|
||||
gettext_noop("Sets the verbosity of logged messages."),
|
||||
|
Reference in New Issue
Block a user