LEFT JOIN in pg_dumpall is a bug - Mailing list pgsql-hackers

From Peter Eisentraut
Subject LEFT JOIN in pg_dumpall is a bug
Date
Msg-id Pine.LNX.4.30.0101232214060.788-100000@peter.localdomain
Whole thread Raw
Responses Re: LEFT JOIN in pg_dumpall is a bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
This snippet in pg_dumpall

$PSQL -d template1 -At -F ' ' \ -c "SELECT datname, usename, pg_encoding_to_char(d.encoding),
datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba
= usesysid) WHERE datallowconn;" | \
while read DATABASE DBOWNER ENCODING ISTEMPLATE DBPATH; do

(line breaks messed up)

won't actually work if there indeed happens to be a database without a
valid owner, because the 'read' command will take ENCODING as the dba
name.

I guess the real question is, what should be done in this case?  I think
it might be better to error out and let the user fix his database before
backing it up.

(At a glance, I think pg_dump also has some problems with these sort of
constellations.)

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: "Mikheev, Vadim"
Date:
Subject: RE: Re: AW: Re: MySQL and BerkleyDB (fwd)
Next
From: Tom Lane
Date:
Subject: Re: "initdb -t" destroys all databases