Skip site navigation (1) Skip section navigation (2)

Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Brendan Jurd <direvus(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
Date: 2008-11-08 01:57:53
Message-ID: 28915.1226109473@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com> writes:
> Brendan Jurd wrote:
>> The changes to the documentation all look good.  I did notice one
>> final typo that I think was introduced in the latest version.
>> doc/src/sgml/datatype.sgml:2270 has "Nonstandardrd" instead of
>> "Nonstandard".

> Just checked in a fix to that one; and updated my website at
> http://0ape.com/postgres_interval_patches/
> and pushed it to my (hopefully fixed now) git server.

> If this'll be the final update to this patch should I be
> posting it to the mailing list too for the archives?

Since it's only one line different from your previous, probably no need.


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.  Either of the traditional Postgres styles are
non-ambiguous and will be interpreted correctly regardless of receiver's
intervalstyle --- in particular, Postgres mode always puts an explicit
sign on the time part if the days or months part was negative.  What
this means is that SQL_STANDARD mode is unsafe for dumping data, and
*pg_dump had better force Postgres mode*.  We can certainly do that with
a couple more lines added to the patch, but it's a bit troublesome that
we are boxed into using a nonstandard dump-data format until forever.

I don't immediately see any way around that, though.  Anyone have a
bright idea?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Ron MayerDate: 2008-11-08 02:45:36
Subject: Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
Previous:From: Dirk RiehleDate: 2008-11-08 01:24:46
Subject: Short CVS question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group