Re: pg_dump bug fixing

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: josh(at)agliodbs(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump bug fixing
Date: 2004-08-03 02:00:41
Message-ID: 410EF1C9.10703@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I've just found a bit of undesirable functionality which I would call a bug in
> pg_dump. I'm not sure everyone would, but we'll see.
>
> Problem: the script which dumps globals such as users (pg_dumpall -g)
> involves deleting *all* users from the pg_shadow table via a direct update to
> that table. What this means in effect is that, should you attempt to use
> "pg_dumpall -g" to *move* a set of users from one active server to another
> (such as for transferring a database) the resulting pg_dump file will delete
> all of the users which previously existed on that server.
>
> This is a non-trivial accident to have happen on a shared machine; once users
> are dumped, all of their ownerships and permissions go with them. If you
> have a complex permissions system, better hope you backed up first!
>
> I find this behavior highly undesirable, and consider it a bug. The globals
> dump should just add users, and not delete any.

Yeah, it's nasty. One of the fixes that's already in from me is to make
the DELETE FROM pg_shadow and DELETE FROM pg_group only appear when -c
mode is set.

Maybe even when -c mode is set we should use DROP USER commands?

Do others agree?

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-08-03 02:03:48 Re: [PATCHES] Patch for pg_dump: Multiple -t options and new -T option
Previous Message Christopher Kings-Lynne 2004-08-03 01:44:05 How to crash postgres using savepoints