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

Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax

From: Christof Petig <christof(at)petig-baender(dot)de>
To: thomas(at)pgsql(dot)com
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, pgsql-bugs(at)postgresql(dot)org, Jacek Jakubowski <jacek(at)wtal(dot)de>, Malte Thoma <thoma(at)uni-muenster(dot)de>
Subject: Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax
Date: 2001-11-05 15:24:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Thomas Lockhart wrote:

> ...
> > > > You mean it works with quotes but not without?
> > > exec sql select "interval"('0sec');  // accepted by ecpg
> > > exec sql select interval('0sec');     // not accepted by ecpg (yesterday's
> > > CVS)
> > Not really surprising I guess since "interval" is accepted as the string
> > >interval< while interval is regarded a token.
> This change was forced by new features to support SQL9x INTERVAL syntax.
> Since the full syntax allows constants of the form "INTERVAL 'val' DAY
> TO MINUTE" I had to change the main parser to make INTERVAL a reserved
> word, as is specified in SQL9x.
> Using internal conversion functions to force type is not recommended (or
> at least shouldn't be). You probably know that CAST('string' AS
> INTERVAL) should work for you, and is SQL9x compliant.

I didn't know this to be SQL compliant (), so we'll switch to the cast syntax.

I was used to the type conversion syntax back from the old days we used other
DBMSs - so this kind of abuse might be common. A friend of mine which is used to
oracle was shocked to see this syntax no longer supported.

PS: Do you know a standard compliant way to combine a date and a time to a


In response to

pgsql-bugs by date

Next:From: Stephan SzaboDate: 2001-11-05 16:51:42
Subject: Re: Referential integrity checking issue
Previous:From: Thomas LockhartDate: 2001-11-05 14:54:09
Subject: Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax

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