Discussion:
pg_dump Error
(too old to reply)
Nigel Bishop
2004-06-29 09:38:03 UTC
Permalink
Hi

I'm getting an error with pg_dump:

I'm using

pg_dump -v -C -U username database > ./dumpfile.dmp

and it errors with:

pg_dump: saving database definition
pg_dump: reading namespaces
pg_dump: reading user-defined types
pg_dump: reading user-defined functions
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined tables
pg_dump: Attempt to lock table "Foo" failed. ERROR: MySchema:
permission denied
pg_dump: *** aborted because of error


Issueing a SELECT * FROM PG_TABLES;

Shows:

MySchema | Foo | postgres | t | f | f


If I try to drop this it errors saying the table foo doesn't exist.

Where did this object come from and how can I resolve the pg_dump error


TIA


Nigel

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Tom Lane
2004-06-29 14:16:03 UTC
Permalink
Post by Nigel Bishop
permission denied
Looks like you need to grant yourself usage rights on the schema
"MySchema".
Post by Nigel Bishop
If I try to drop this it errors saying the table foo doesn't exist.
Can't tell whether you forgot to schema-qualify the name or whether
you forgot to quote it to protect the mixed case, but something
along the lines of
drop table "MySchema"."Foo";
is what you would need. Note that that will also fail unless you've
fixed the permissions problem for MySchema, though.
Post by Nigel Bishop
Where did this object come from
Presumably, you created it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Guido Barosio
2004-06-29 11:27:13 UTC
Permalink
An idea only.

Ever try this?


select reltype from pg_class where relname='foo';

Then, delete the reltype from pg_class

To me goes fine.

Best wishes,
Guido
Post by Nigel Bishop
Hi
I'm using
pg_dump -v -C -U username database > ./dumpfile.dmp
pg_dump: saving database definition
pg_dump: reading namespaces
pg_dump: reading user-defined types
pg_dump: reading user-defined functions
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined tables
permission denied
pg_dump: *** aborted because of error
Issueing a SELECT * FROM PG_TABLES;
MySchema | Foo | postgres | t | f | f
If I try to drop this it errors saying the table foo doesn't exist.
Where did this object come from and how can I resolve the pg_dump error
TIA
Nigel
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ***@postgresql.org
Loading...