Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Tom Lane" <tgl(at)postgresql(dot)org>, "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords
Date: 2007-06-26 15:15:07
Message-ID: 87tzsuhhms.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

"Andrew Dunstan" <andrew(at)dunslane(dot)net> writes:

> Gregory Stark wrote:
>> I'm thinking it may make sense to lie about all of these in quote_identifier
>> so that someone who upgrades from 8.2 to 8.3 can then upgrade to 8.4. If we
>> add reserved words in one step then there's no way to upgrade except to rename
>> things before dumping. Any comments?
>
> I'm confused. Won't pg_dump quote the keywords it knows its postgres version
> will need quoted? We can't expect it to have knowledge of future requirements
> for quoting

Well as far as standard syntax from the spec we can. But you're right, as
Heikki pointed out offline, the approved upgrade path is to use the pg_dump
from the target version to dump the old database.

It may still be worth telling one version of Postgres about anticipated
keywords prior to a release which adds them so that people who don't follow
instructions and try a dump generated with an old pg_dump have a fighting
chance. Besides, what's a person to do if they have a dump lying around?
Restore it in an old database so they can re-dump it with the new pg_dump?

That said, this would only bite someone who is using columns named "cube" or
"rows" *and* uses the old pg_dump or tries to restore a dump they already
have without re-dumping with the new pg_dump. It may just not be worth
worrying about.

> unless someone really does invent time travel (in which case someone could
> just go to the future and bring back version 107.6 and save us all the
> trouble).

That would revolutionize the IP law field....

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2007-06-26 15:31:31 Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords
Previous Message Tom Lane 2007-06-26 15:13:02 Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-06-26 15:31:31 Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords
Previous Message Tom Lane 2007-06-26 15:13:02 Re: [COMMITTERS] pgsql: Arrange for quote_identifier() and pg_dump to not quote keywords