OWNER TO on all objects

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: OWNER TO on all objects
Date: 2004-06-15 03:04:22
Message-ID: 40CE6736.5090207@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

This is a preview patch - DON'T COMMIT IT TO HEAD!

What I've done in this patch is add the following:

ALTER AGGREGATE / OWNER TO
ALTER CONVERSION / OWNER TO
ALTER FUNCTION / OWNER TO
ALTER OPERATOR / OWNER TO
ALTER OPERATOR CLASS / OWNER TO
ALTER SCHEMA / OWNER TO
ALTER TYPE / OWNER TO

That means we can change the owner of all objects.

Next, I modified pg_dump to remove all SET SESSION AUTHORIZATION
commands for object creation. (I left them in on the COPY commands).

Then I made it so that pg_dump will output an OWNER TO statement after
every object creation.

This means that pg_dump can dump a restorable dump in cases where, say,
a super user created a language, and then had their superuser privs
dropped, or when a user has created a table, but has then had their
create privileges removed.

At the moment, i'm happy with how it dumps and reloads the regression
database, and i'm working on adding tests for all OWNER TO in the
regression suite. Full doc updates are already included.

Please review and give me feedback! The patch is large, but not at all
complex :)

Some questions:

* Do we need the set session auth for COPY commands still?

* Are there any subtle implications of changing owners that I haven't
realised? I know that it will affect SECURITY DEFINER for functions,
but I put that in the docs.

* Is doing this ok: ObjectIdGetDatum(typTup->typrelid)

* Is there any reason there is no RENAME TO command for operators?

Chris

Attachment Content-Type Size
owner.tar.gz application/x-gzip 14.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-06-15 03:15:51 Re: Passing typmod to cast functions (for int-to-bit casting)
Previous Message Tom Lane 2004-06-15 02:52:07 Re: Passing typmod to cast functions (for int-to-bit casting)