Problem when reloading data from older version

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Problem when reloading data from older version
Date: 1999-06-07 23:32:54
Message-ID: 199906072332.AAA15047@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Restoring a full dump from 6.4.2 into 6.5:

When the owner of a database does not have usesuper privilege in pg_shadow,
it is not possible to recreate items that were created with superuser
privilege, even if the superuser is running the script:

======== example ==============
\connect template1
select datdba into table tmp_pg_shadow from pg_database where datname =
'template1';
delete from pg_shadow where usesysid <> tmp_pg_shadow.datdba;
drop table tmp_pg_shadow;
copy pg_shadow from stdin;
...
user1 1005 t t f t \N
\.
\connect template1 user1
create database morejunk;
\connect morejunk user1
...
CREATE FUNCTION "plpgsql_call_handler" ( ) RETURNS opaque AS
'/usr/lib/postgresql/lib/plpgsql.so' LANGUAGE 'C';
...

Result:
QUERY: CREATE FUNCTION "plpgsql_call_handler" ( ) RETURNS opaque AS
'/usr/lib/postgresql/lib/plpgsql.so' LANGUAGE 'C';
ERROR: Only users with Postgres superuser privilege are permitted to create a
function in the 'C' language. Others may use the 'sql' language or the
created procedural languages.
======================

It would seem that there should be some command that operates with
superuser privilege, whatever the nominal state indicated by the data.
Since the above script was being run by postgres, it should all have
been capable of being executed.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"There is a way that seems right to a man, but in the
end it leads to death."
Proverbs 16:25

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-06-08 00:13:21 Re: [HACKERS] Problem when reloading data from older version
Previous Message Bruce Momjian 1999-06-07 23:03:11 Re: [HACKERS] PostgreSQL History(Parody)