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 20:50:14
Message-ID: 22238.1226177414@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com> writes:
> Yes, at first glance I think that approach is better; but we'd need
> to make sure not to apply the rule too enthusiastically on traditional
> postgres intervals;

Well, of course we'd only apply it in SQL_STANDARD mode. The idea here
is that intervalstyle helps us resolve an ambiguity about what the signs
are, more or less independently of syntactic details. If you consider
that the issue is
sql standard: leading sign applies to all fields
postgres: each field is independently signed
this applies perfectly well without any restrictions on syntax.

> In some ways I wonder if we should have 2 totally separate parsing
> one for the SQL standard ones, and one for the postgres.

No, I think we want the style to be a hint for resolving ambiguous
cases, not to cause complete failure if the input doesn't conform to the
style. That's certainly how DateStyle has always worked.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-08 21:03:32 Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
Previous Message Tom Lane 2008-11-08 20:30:53 Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle