Re: Proposed patch: make SQL interval-literal syntax work per spec

Поиск
Список
Период
Сортировка
От Ron Mayer
Тема Re: Proposed patch: make SQL interval-literal syntax work per spec
Дата
Msg-id 48CAD72E.90406@cheapcomplexdevices.com
обсуждение исходный текст
Ответ на Re: Proposed patch: make SQL interval-literal syntax work per spec  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Proposed patch: make SQL interval-literal syntax work per spec
Список pgsql-hackers
Tom Lane wrote:
> The reason it's not SQL-standard is the data value isn't.
> So not a problem.  Someone conforming to the spec limits on
> what he puts in will see spec-compliant output.  I think all
> you need is 'yyy-mm dd hh:mm:ss' where you omit yyy-mm if
> zeroes, omit dd if zero, omit hh:mm:ss if zeroes (but maybe
> only if dd is also 0?  otherwise your output is just dd which
> is uncomfortably ambiguous).

Great.  That's what I'll do.

Any convention or preference on the naming of the GUC?
I assume "intervalstyle" is reasonable?

Or thoughts regarding the current EncodeInterval() that's
already using the "datestyle" GUC?


pg82=# select interval '1'; interval
---------- 00:00:01
(1 row)

pg82=# set datestyle='sql';
SET

pg82=# select interval '1'; interval
---------- @ 1 sec
(1 row)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proposed patch: make SQL interval-literal syntax work per spec
Следующее
От: Ron Mayer
Дата:
Сообщение: Re: Proposed patch: make SQL interval-literal syntax work per spec