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

Re: BUG #1517: SQL interval syntax is accepted by the parser,

From: Roy Badami <roy(at)gnomon(dot)org(dot)uk>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Roy Badami <roy(at)gnomon(dot)org(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date: 2005-03-20 14:44:15
Message-ID: 16957.35903.590223.328021@giles.gnomon.org.uk (view raw or flat)
Thread:
Lists: pgsql-bugs
    Bruce> I guess my point is that we should allow:

    Bruce> 	select interval '1' day '1' hour

    Bruce> as SQL standard and equavalent to:

Ah, I think you're misunderstanding what the SQL standard interval
literal syntax looks like.

It would be

   INTERVAL '1 1' DAY TO HOUR

Essentially the full syntax for a day-time interval is

   INTERVAL '1 2:03:04' DAY TO SECOND

and the full syntax of a year-month interval is

   INTERVA: '1-2' YEAR TO MONTH

but if you use a more restricted interval type you omit the fields
that aren't present in your interval type.

In response to

Responses

pgsql-bugs by date

Next:From: Roy BadamiDate: 2005-03-20 15:46:50
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous:From: Bruce MomjianDate: 2005-03-20 14:39:15
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,

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