An item for the TODO list: pg_dump and multiple table owners

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: An item for the TODO list: pg_dump and multiple table owners
Date: 1998-05-06 19:51:50
Message-ID: 13432.894484310@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pg_dump doesn't cope very gracefully at all with databases containing
multiple tables not all owned by the same person. It knows enough
to issue \connect commands in the reload script that cause the
new tables to be owned by the same people as before. But the reload
script fails with permission errors later on during the data copying
phase, if the tables are not made world-writable.

This is certain to happen if the -z switch is not used to dump the
tables' grant/revoke status. I suspect that pg_dump ought not try
to save/restore table ownership unless it is also saving/restoring
access rights; that is, if -z is not given the \connect commands
shouldn't appear either. Then, without -z the reload script will
generate a new database wholly owned by the script invoker.

When using -z, the failure of the copy-in command could be fixed by
issuing more \connect commands so that the data transfer is done while
logged in as the table owner.

This is particularly nasty because the reload script fails even if
run as the Postgres superuser. I think this is because the script
reconnects as the various table owners and thereby loses superuser
access rights.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 1998-05-06 20:46:56 Re: [HACKERS] OK to send e-mail?
Previous Message Tom Lane 1998-05-06 19:33:04 Another missing regression test