Greetings, Discussing psql options made me recall an annoying problem that we've run into. There's no way (unless it was added to 8.3 and I missed it, but I don't think so) to tell pg_dump 'switch to this role before doing anything else'. That's very frustrating when you use no-inherit roles for admins. eg:
create role admin with noinherit; grant postgres to admin; grant admin to joesysadmin; pg_dump -U joesysadmin mydb; Fails because joesysadmin hasn't got rights to everything directly. It'd be nice if pg_dump could take a '-r postgres' to 'set role' to a role which has the necessary permissions before locking all the tables and whatnot. The same 'set role' would also be included at the top of the resulting dump file. We could have a seperate flag for that but I don't think it's necessary. Comments? I doubt there'd be very much code involved but I'd be willing to write a patch if people agree with the general idea/approach. Thanks, Stephen
signature.asc
Description: Digital signature