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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Roy Badami <roy(at)gnomon(dot)org(dot)uk>,Bruce Momjian <pgman(at)candle(dot)pha(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-19 16:55:05
Message-ID: 16956.22889.962007.979933@giles.gnomon.org.uk (view raw or flat)
Thread:
Lists: pgsql-bugs
    Tom> Feel like hacking the code?

Hmm, in principle I might take a look some time; in reality it's
unlikely I'll have time any time soon...

There are some design issues involved, though.  If you have the type
modifier, do you isnist on SQL syntax in the string?

ie do you accept

   interval '1 day 1 hour' day to second

Personally I think it would be a bad idea to allow hybrid SQL/postgres
syntax like this.

IMHO, you should either write

   interval '1 day 1 hour'  

(postgres style), or

   interval '1 1:00:00' day to second

(SQL style.)

Hmm, except writing the above has just raised another question.  Is
that what the postgres-ism really means (I think it does) or does it
mean

   interval '1 1' day to hour

Once you start distinguishing your interval types, does this become
important?  Actually, I can't immediately see a case where it would
matter, but that doesn't mean there isn't one...

	-roy


In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-03-19 18:08:06
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous:From: Stephan SzaboDate: 2005-03-19 16:53:57
Subject: Re: BUG #1518: Conversions to (undocumented) SQL year-month

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