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 48CC242A.9040704@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 8.3 vs HEAD difference in Interval output?  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
8.3 vs HEAD difference in Interval output?  (R Mayer <pg_cert@cheapcomplexdevices.com>)
List pgsql-hackers
Tom Lane wrote:
> Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
>> interval ... "sql_standard"..."iso_8601"...
>> "backward_compatible" ...depends... on ... DateStyle...
> 
> ...How about decoupling interval_out's behavior
> from DateStyle altogether, and instead providing values of IntervalStyle
> that match all the previous behaviors?

Great.  That seems much more sane.

Any desired names for the existing interval styles?

Currently we output intervals in these two styles: '1 year 2 mons 3 days 04:05:06' when the DateStyle is iso.
and '@ 1 year 2 mons 3 days 4 hours 5 mins 6 secs' when the DateStyle is sql or postgres, etc.

I'm not quite sure where those styles came from so
don't know what good names for them might be.

>> Should those ECPG functions be made identical ...
> ...
> The palloc and elog dependencies seem to be the hard part.

Interesting.   So EncodeDateTime and EncodeInterval, guessing 400 or
so lines, seem sharable since at first glance they either already do or
easily could make their callers deal with all allocation and logging.

Agreed that it's a independent patch that I'll try separately.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.3.3 compiler warnings with gcc 4.3
Next
From: "David E. Wheeler"
Date:
Subject: Re: [Review] Tests citext casts by David Wheeler.