Re: Proposed patch: make SQL interval-literal syntax work per spec - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: Proposed patch: make SQL interval-literal syntax work per spec
Date
Msg-id 48CAD72E.90406@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Proposed patch: make SQL interval-literal syntax work per spec  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposed patch: make SQL interval-literal syntax work per spec  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposed patch: make SQL interval-literal syntax work per spec
Next
From: Ron Mayer
Date:
Subject: Re: Proposed patch: make SQL interval-literal syntax work per spec