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

From Tom Lane
Subject Re: Proposed patch: make SQL interval-literal syntax work per spec
Date
Msg-id 27939.1221279300@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposed patch: make SQL interval-literal syntax work per spec  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Responses Re: Proposed patch: make SQL interval-literal syntax work per spec  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-hackers
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> Cool.  I think I have it pretty much working with a new
> GUC "intervalstyle" that can take values of

> "sql_standard" that I think will output SQL standard
>                 interval literals when given a sql
>                 standard interval.

> "iso_8601" that will output ISO 8601 "Time Intervals" of
>             the "format with time-unit deignators", and

> "backward_compatible" that will output the same thing
>             that postgres currently does that depends
>             on the value of the DateStyle GUC.

Actually, we have never considered that new releases need to preserve
the behavior of postgresql.conf settings.  So the above seems
unnecessarily baroque.  How about decoupling interval_out's behavior
from DateStyle altogether, and instead providing values of IntervalStyle
that match all the previous behaviors?

> Should those ECPG functions be made identical to
> the ones in the backend?

The ECPG situation is a mess :-(.  That code was forked off from the
backend some time ago, and has not been well maintained at all.  If you
are brave enough to tackle that mess, more power to you; but I strongly
suggest doing it as an independent patch.

> Could those somehow share code with the backend for
> some of their work?

The palloc and elog dependencies seem to be the hard part.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Upcoming back-branch update releases
Next
From: Decibel!
Date:
Subject: Re: New FSM allocation policy