serial types, pg_depend, permissions

From: Christopher St John <ckstjohn(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: serial types, pg_depend, permissions
Date: 2005-10-07 15:05:10
Message-ID: 8ba906450510070805h1756c3a7if0e4aaa0c4c432f4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

i'm using pgadmin3 v1.2.2 on os x against a postgres 8.0.3 server to
add a bigserial column to a table. i'm getting the error:

ERROR: permission denied for relation pg_depend

i did a search on the mailing list and found some references to problems,
but none matched exactly.

the sql from the "SQL" tab of the "New Column" dialog looks like this:

CREATE SEQUENCE public.categories_idtest_seq;
ALTER TABLE categories
ADD COLUMN idtest int8;
ALTER TABLE categories
ALTER COLUMN idtest SET DEFAULT
nextval('public.categories_idtest_seq'::text);
INSERT INTO pg_depend(classid, objid, objsubid, refclassid, refobjid,
refobjsubid, deptype)
SELECT cl.oid, seq.oid, 0, cl.oid, 54592::oid, attnum, 'i'
FROM pg_class cl, pg_attribute, pg_class seq
JOIN pg_namespace sn ON sn.OID=seq.relnamespace
WHERE cl.relname='pg_class'
AND seq.relname='categories_idtest_seq'
AND sn.nspname='public'
AND attrelid=54592::oid AND attname='idtest';

the insert into pg_depend is an obvious candidate for the problem, since
i don't have the proper permissions to insert into the pg_depend table. (the
database was created for me by my hosting provider, and the pg_depend
table is owned by pgsql, not by my id)

now, normally i'd assume it was a permissions problem with pg_depend,
except that manually adding the table using the following command (as
executed through the pgadmin query tool) works fine:

ALTER TABLE categories ADD COLUMN idtest bigserial

the appropriate sequence is autocreated, and the appropriate entry appears
to get dumped into pg_depend with no errors. (i can delete the column and
the sequence is dropped automatically, again with no errors)

- is this a pgadmin3 bug, or purely a configuration problem?

- if it's a configuration problem, why does the query-tool version work?
shouldn't pgadmin be spitting out the shorthand version and letting
postgres do the sequence creation and pg_depend work?

thanks,

-cks

Christopher St. John
Chief Software Architect
http://www.homeconductor.com
http://artofsystems.blogspot.com

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2005-10-07 15:09:00 Re: pgadmin 1.4beta problem
Previous Message Roberto Tagliaferri 2005-10-07 14:52:33 pgadmin 1.4beta problem