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

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

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, 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 15:11:06
Message-ID: 4915AC0A.9070608@cheapcomplexdevices.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane wrote:
> Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com> writes:
>> Rather than forcing Postgres mode; couldn't it put a
>> "set intervalstyle = [whatever the current interval style is]"
>> in the dump file?
> 
> This would work for loading into a PG >= 8.4 server, and fail miserably
> for loading into pre-8.4 servers.  Even though we don't guarantee
> backwards compatibility of dump files, I'm loath to adopt a solution
> that will successfully load wrong data into an older server.

How is the case different from standard_conforming_strings; where ISTM
depending on postgresql.conf 8.4 will happily dump either

   SET standard_conforming_strings = off;
   ...
   INSERT INTO dumptest VALUES ('\\\\');

or

   SET standard_conforming_strings = on;
   ...
   INSERT INTO dumptest VALUES ('\\');

and AFAICT the latter will happily load wrong data into 8.1 with
only the error message

   ERROR:  parameter "standard_conforming_strings" cannot be changed

I imagine the use-case for "standard_conforming_strings = 0 " and
"intervalstyle = sql_standard" are petty similar as well.



I wonder if the best solution is that any dump file with
standard_conforming_strings=on include some SQL that will refuse
to load in pre-8.2 systems; and that any dump file with
intervalstyle=sql_standard refuse to load in pre-8.4 systems.
It seems pretty easy to add a sql fragment that checks version()
and put that in the beginning of a dump file that uses these GUCs
to enforce this.

In response to

pgsql-hackers by date

Next:From: Hitoshi HaradaDate: 2008-11-08 15:51:10
Subject: Re: Windowing Function Patch Review -> Standard Conformance
Previous:From: David RowleyDate: 2008-11-08 15:03:37
Subject: Re: Windowing Function Patch Review -> Standard Conformance

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