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

From: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
To: Michael Meskes <meskes(at)postgresql(dot)org>, Christof Petig <christof(at)petig-baender(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax
Date: 2001-11-05 14:54:09
Message-ID: 3BE6A811.460ECF2F@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

...
> > > 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.

- Thomas

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Christof Petig 2001-11-05 15:24:54 Re: recent ECPG 7.1->7.2 incompatibility ( interval('0sec') = syntax
Previous Message pgsql-bugs 2001-11-05 14:28:51 Bug #509: read error on Win32 depending on network