Re: [GENERAL] Changing table owner to db owner.

2010-12-15 Thread Radosław Smogura
Try this: 1. Open psql console as user postgres. 2. Execute SELECT ('\\c ' || datname || '\nALTER TABLE the_table_name OWNER TO ' || rolname || ';\n') from pg_database join pg_authid on datdba = pg_authid.oid; 3. Check results. 4. Select results with mouse. 5. Paste it to postgres console (Middle

Re: [GENERAL] Changing table owner to db owner.

2010-12-15 Thread Radosław Smogura
Try this: 1. Open psql console as user postgres. 2. Execute SELECT ('\\c ' || datname || '\nALTER TABLE the_table_name OWNER TO ' || rolname || ';\n') from pg_database join pg_authid on datdba = pg_authid.oid; 3. Check results. 4. Select results with mouse. 5. Paste it to postgres console (Midd

Re: [GENERAL] Changing table owner to db owner.

2010-12-14 Thread Adrian Klaver
On Tuesday 14 December 2010 5:58:16 pm Paul McGarry wrote: > On Wed, Dec 15, 2010 at 12:39 PM, Adrian Klaver wrote: > > You did not say what version you are using. In 9.0 you have this option: > > http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges > >.html > > Our servers a

Re: [GENERAL] Changing table owner to db owner.

2010-12-14 Thread Paul McGarry
On Wed, Dec 15, 2010 at 12:39 PM, Adrian Klaver wrote: > You did not say what version you are using. In 9.0 you have this option: > http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges.html Our servers are a mix of 8.3 and 8.4. > I generally do as superuser; > > SET ROLE us

Re: [GENERAL] Changing table owner to db owner.

2010-12-14 Thread Adrian Klaver
On Tuesday 14 December 2010 5:02:56 pm Paul McGarry wrote: > I have a number of DBs that are all the same structure but are owned > by different users and I want to add a table to each of those DBs. > > At the moment I have to either connect to each DB as it's user (which > means digging up it's pa