8.5.5. Interval Output

8.5.5. Interval Output
8.5.5.interval output
The output format of the interval type can be set to one of the four styles sql_standard , postgres , postgres_verbose , or iso_8601 , using the command SET intervalstyle . The  default is the postgres format. Table 8.18 shows examples of each output style.
type interval output format may be used to set the command SET intervalstyle following four: sql_standard , Postgres , postgres_verbose or iso_8601. The default is postgres. Each output sample format See Table 8.18.
 
The sql_standard style produces output that conforms to the SQL standard's specification for  interval literal strings, if the interval value meets the standard's restrictions (either year-month only or  day-time only, with no mixing of positive and negative components). Otherwise the output looks like  a standard year-month literal string followed by a day-time literal string, with explicit signs added to  disambiguate mixed-sign intervals.
If the interval limit value satisfies the standard SQL (only the date or day only, and there is no mixing of positive and negative values), the output interval generated sql_standard style character string that conforms to the SQL standard specification. Otherwise, the output is a standard date text string, followed by the date, time, text string, and explicitly with symbols to eliminate ambiguity.
 
The output of the postgres style matches the output of PostgreSQL releases prior to 8.4 when the  DateStyle parameter was set to ISO .
When the parameter is set to DateStyle ISO, postgres output style and the PostgreSQL . 8 before .4 output matching version.
 
The output of the postgres_verbose style matches the output of PostgreSQL releases prior to  8.4 when the DateStyle parameter was set to non- ISO output.
When the parameter is set to a non-ISO DateStyle output, the output style postgres_verbose PostgreSQL before 8.4 output matching version.
 
The output of the iso_8601 style matches the “format with designators” described in section 4.4.3.2  of the ISO 8601 standard.
iso_8601 pattern output section 4.4.3.2 of the ISO 8601 standard (not found in this section) "format with the indicator" described match.
 
Published 341 original articles · won praise 54 · views 880 000 +

Guess you like

Origin blog.csdn.net/ghostliming/article/details/104662582