Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
От | Tom Lane |
---|---|
Тема | Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle |
Дата | |
Msg-id | 127.1226113404@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle (Ron Mayer <rm_pg@cheapcomplexdevices.com>) |
Ответы |
Re: Patch for SQL-Standard Interval output and decoupling
DateStyle from IntervalStyle
|
Список | pgsql-hackers |
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes: > Tom Lane wrote: >> I've started reviewing this patch for commit, and I find myself a bit >> disturbed by its compatibility properties. The SQL_STANDARD output >> style is simply ambiguous: what is meant by >> -1 1:00:00 >> ? What you get from that will depend on the intervalstyle setting at >> the recipient. > Nope. The SQL Standard style avoids the ambiguity by following > the SQL Standard's rules when the input value complied with the > standard's restrictions on intervals. You're missing the point: the same string can mean different things to different recipients depending on their intervalstyle setting. This means it's unsafe to use that representation in pg_dump output, unless we take steps to force the interpretation. > Are you concerned about someone dumping in SQL_STANDARD mode and > then importing in POSTGRES mode? Exactly. > If so, how's the similar case handled with date order? ISO date format is read the same regardless of recipient's datestyle, so pg_dump solves this by forcing the dump to be made in ISO style. The corresponding solution for intervals will be to dump in POSTGRES style, not SQL_STANDARD style, which seems a bit unfortunate. regards, tom lane
В списке pgsql-hackers по дате отправления: