Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Changing table owners



> How do I change the owner of a table ?
>
>   ------------------------------------------------------------------------
>
>    * From: Daniele Orlandi <daniele(at)orlandi(dot)com>
>    * To: pgsql-general(at)postgreSQL(dot)org
>    * Subject: How do I change the owner of a table ?
>    * Date: Thu, 27 Aug 1998 18:31:57 +0200
>
>   ------------------------------------------------------------------------
>
> I'm not able to figure out how to change the owner of a relation, in particular
> of a table.
>
> Do I need to directly modify one of the pg_* tables ?
>
> Thanks in advance!
>
> --
>  Daniele
>

Try:
(a) granting permissions to new owner
(b) update pg_class set relowner = $new_owner where relname = '$table_name'
(c) update pg_type set typowner = $new_owner where typname = '$table_name'

Hope this works.

I've just tried this, and it seems to work, but if anyone has any better ideas,
could you please let us know.

Thanks

Pete




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group