ecpg & 8.3 -> 8.4 migration

Started by Bosco Ramaabout 16 years ago5 messages
#1Bosco Rama
postgres@boscorama.com

Howdy folks,

I have an application that works just fine in PG 8.3.
We've installed 8.4 on another machine to perform pre-
migration testing. When we tried to compile our ecpg
stuff under 8.4 the first thing that caught us was an
error stating that the column name 'server' was causing
an error.

According to the PG docs 'server' is a *non-reserved*
keyword. Does ecpg treat it as a reserved word?

TIA

Bosco.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bosco Rama (#1)
Re: ecpg & 8.3 -> 8.4 migration

Bosco Rama <postgres@boscorama.com> writes:

According to the PG docs 'server' is a *non-reserved*
keyword. Does ecpg treat it as a reserved word?

Upon poking around in the ecpg sources, I discover that it has its own
list of "unreserved" keywords and pays no attention whatsoever to the
core grammar's unreserved_keyword list. I can hardly find words to
express my dissatisfaction with that. The unreserved_keyword list might
not be the single most-likely-to-change production in the core grammar,
but it's got to be right up there in the top two or three. This little
shortcut means that all the work done last year to generate the ecpg
grammar from core was practically useless --- we still have to worry
about manually maintaining the ecpg grammar any time we change core.

This has *got* to be fixed. The lack of obvious feedback about keywords
not included in any keyword list means that manual maintenance is
guaranteed to fail, as indeed it's already done, per this report.

regards, tom lane

#3Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#2)
Re: ecpg & 8.3 -> 8.4 migration

On Fri, Nov 20, 2009 at 07:02:11PM -0500, Tom Lane wrote:

Upon poking around in the ecpg sources, I discover that it has its own
list of "unreserved" keywords and pays no attention whatsoever to the
core grammar's unreserved_keyword list. I can hardly find words to
express my dissatisfaction with that. The unreserved_keyword list might

I cannot agree more. Sorry about that, it seems this one got forgotten. I
wasn't aware of this blunder.

Thanks for fixing it Tom.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ: 179140304, AIM/Yahoo/Skype: michaelmeskes, Jabber: meskes@jabber.org
VfL Borussia! Forca Barca! Go SF 49ers! Use: Debian GNU/Linux, PostgreSQL

#4Mark Richardson
markmapo@yahoo.com
In reply to: Tom Lane (#2)
Re: ecpg & 8.3 -> 8.4 migration

I'm pretty sure the problem I found is related to this, but I found that ecpg doesn't process booleans correctly- this was in a old version of postgres (I think it was 7.4.2).  I traced it down in the code, and there is a section that defines the values to be "yes" or "no", but then further processing looks for "true" or "false", so the end result is that a boolean is ALWAYS false, because the 2 filters don't match.
 
If you're interested in more detail, I have code fixes (they are at work so I'll send on Monday).
Mark

--- On Fri, 11/20/09, Tom Lane <tgl@sss.pgh.pa.us> wrote:

From: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: [INTERFACES] ecpg & 8.3 -> 8.4 migration
To: "Bosco Rama" <postgres@boscorama.com>
Cc: pgsql-interfaces@postgresql.org, pgsql-hackers@postgresql.org, "Michael Meskes" <meskes@postgresql.org>
Date: Friday, November 20, 2009, 5:02 PM

Bosco Rama <postgres@boscorama.com> writes:

According to the PG docs 'server' is a *non-reserved*
keyword.  Does ecpg treat it as a reserved word?

Upon poking around in the ecpg sources, I discover that it has its own
list of "unreserved" keywords and pays no attention whatsoever to the
core grammar's unreserved_keyword list.  I can hardly find words to
express my dissatisfaction with that.  The unreserved_keyword list might
not be the single most-likely-to-change production in the core grammar,
but it's got to be right up there in the top two or three.  This little
shortcut means that all the work done last year to generate the ecpg
grammar from core was practically useless --- we still have to worry
about manually maintaining the ecpg grammar any time we change core.

This has *got* to be fixed.  The lack of obvious feedback about keywords
not included in any keyword list means that manual maintenance is
guaranteed to fail, as indeed it's already done, per this report.

            regards, tom lane

--
Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces

#5Michael Meskes
meskes@postgresql.org
In reply to: Mark Richardson (#4)
Re: ecpg & 8.3 -> 8.4 migration

On Sat, Nov 21, 2009 at 12:49:33PM -0800, Mark Richardson wrote:

I'm pretty sure the problem I found is related to this, but I found that ecpg
doesn't process booleans correctly- this was in a old version of postgres (I
think it was 7.4.2).  I traced it down in the code, and there is a section
that defines the values to be "yes" or "no", but then further processing
looks for "true" or "false", so the end result is that a boolean is ALWAYS
false, because the 2 filters don't match.  

Is this a bug that you saw back then in 7 something, or a bug you still see?

If you're interested in more detail, I have code fixes (they are at work so I'll send on Monday).

Please send them. I'm interested.

Michael

--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ: 179140304, AIM/Yahoo/Skype: michaelmeskes, Jabber: meskes@jabber.org
VfL Borussia! Forca Barca! Go SF 49ers! Use: Debian GNU/Linux, PostgreSQL