Re: PostgreSQL Gotchas - Mailing list pgsql-general

From Greg Stark
Subject Re: PostgreSQL Gotchas
Date
Msg-id 87wtkgha5x.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: PostgreSQL Gotchas  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PostgreSQL Gotchas  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PostgreSQL Gotchas  (Chris Travers <chris@travelamericas.com>)
List pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> If you write, say,
>
>     select max(relpages) from pg_class;
>
> and the lexer thinks that it should fold unquoted identifiers to upper
> case, then the catalog entries defining these names had better read
> PG_CLASS, RELPAGES, and MAX, not the lower-case names they contain
> today.

Well the case of unquoted identifiers could be finessed by having it match
RELPAGES first and fail over to relpages second. It could even be made to
match RelPages and whatever if there isn't any ambiguity.

I think the problem case arises when you have code that has a quoted
"relpages". In that case the code is just not going to work unless the column
really is named "relpages" not "RELPAGES".

So to be completely backward compatible you need "relpages" as well as an
unquoted relpages to work. And to be spec compliant you need "RELPAGES" to
work too. That makes things a bit sticky.

--
greg

pgsql-general by date:

Previous
From: srikanth potluri
Date:
Subject: installation guide
Next
From: "A. Kretschmer"
Date:
Subject: Re: installation guide