Re: BUG #1518: Conversions to (undocumented) SQL year-month and

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Roy Badami <roy(at)gnomon(dot)org(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1518: Conversions to (undocumented) SQL year-month and
Date: 2005-03-23 22:48:56
Message-ID: 200503232248.j2NMmu425952@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Roy Badami wrote:
> Bruce> Here is an email stating it is implementation defined:
>
> Bruce> http://archives.postgresql.org/pgsql-bugs/2005-03/msg00162.php
>
> Hmm, looks like I'm mistaken, then. In fact the "whether to truncate
> or round" bit suggests you should do one or the other, rather than
> raise an exception.
>
> Will have to take a look at the spec when I get a moment...

OK, TODO updated:

o Round or truncate values to the requested precision, e.g.
INTERVAL '11 months' AS YEAR should return one or zero

The full TODO section is:

* Add ANSI INTERVAL handling
o Add support for day-time syntax, INTERVAL '1 2:03:04'
DAY TO SECOND
o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
o Interpret syntax that isn't uniquely ANSI or PG, like '1:30' or
'1' as ANSI syntax, e.g. interpret '1:30' MINUTE TO SECOND as
'1 minute 30 seconds'
o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
INTERVAL MONTH), and this should return '12 months'
o Round or truncate values to the requested precision, e.g.
INTERVAL '11 months' AS YEAR should return one or zero
o Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-03-23 22:52:02 Re: BUG #1518: Conversions to (undocumented) SQL year-month and
Previous Message Roy Badami 2005-03-23 22:47:40 Re: BUG #1517: SQL interval syntax is accepted by the parser,