Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading

From: Hartmut Goebel <h(dot)goebel(at)goebel-consult(dot)de>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5488: pg_dump does not quote column names -> pg_restore may fail when upgrading
Date: 2010-06-04 15:55:33
Message-ID: 4C0921F5.4020907@goebel-consult.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Am 04.06.2010 14:57, schrieb Stephen Frost:
> * Hartmut Goebel (h(dot)goebel(at)goebel-consult(dot)de) wrote:
>> Am 04.06.2010 13:56, schrieb Stephen Frost:
>>> Quoting all column names makes the dump script much more difficult for
>>> human consumption, which is important.
>>
>> I don't agree with you here. But this may be a matter of personal taste.
>>
>> Esp. I think, functionality is much ore important than a small decrees
>> of readability. At least pg_dump should get an option
>> "--quote-column-names", so this can be switcced on if necessary.
>
> Something like '--quote-identifiers' might be alright, so long as it's
> defaulted to 'off'. Of course, I don't know that it'd actually solve
> your problem at all- after all, keywords can and will change between
> major versions and even if your pg_dump quotes all identifiers, anything
> else using the database (eg: applications) would need to as well.

The application already quotes all column names :-) It's using a generic
framework which does not (and must not) rely on column names being
non-keywords.

> If you're using pg_dump to upgrade, use the pg_dump from the version
> you're upgrading *to*, and do so in a test environment first to make
> sure that the restore works correctly, that the applications and other
> DB users are happy with the new version, etc, etc, before even thinking
> about upgrading a production system.

This is correct -- in theory. In practice there are many average system
administrators which need an easy upgrade path. You may call this
unprofessional, but this is reality.

To put it on the point: Is postgres meant for average administrators or
for elite database admins? In the first case, developers should think
about how to make work easier for the average ones.

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2010-06-04 15:57:24 Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Previous Message Tom Lane 2010-06-04 15:53:05 Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail