Unix Technical Forum

Error:PG_DUMP relation pg_user does not exist

This is a discussion on Error:PG_DUMP relation pg_user does not exist within the pgsql Admins forums, part of the PostgreSQL category; --> I am running Postgresql 7.4.7. on RedHat ES-64 version 4 on a Dual-Opteron Dual Core system. I am having ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 05:25 AM
Fred Pope
 
Posts: n/a
Default Error:PG_DUMP relation pg_user does not exist

I am running Postgresql 7.4.7. on RedHat ES-64 version 4 on a
Dual-Opteron Dual Core system.

I am having problems with the pg_dump command due to improper
initialization of the Database cluster on RH ES 4.

The initial symptom was visible on execution of the command:

pg_dump mydatabase > /tmp/mydatabase.dump

<error-message>
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: relation "pg_user" does not
exist
pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE
usesysid = datdba) as dba, pg_encoding_to_char(encoding) as encoding,
datpath FROM pg_database WHERE datname = 'mydatabase'
</error-message>

Hence I went into the mydatabase catalog and created that above
mentioned view, and now when I execute that query from within the
respective catalogs I get:

<response>
mydatabase=# select (select usename from pg_user where usesysid =
datdba) as dba, pg_encoding_to_char(encoding), datpath as encoding from
pg_database where datname = 'mydatabase';
dba | pg_encoding_to_char | encoding
----------+---------------------+----------
postgres | SQL_ASCII |
(1 row)
</response>

When the database engine is calling this query from the pg_dump command,
I am assuming this is calling from the database that you are trying to
dump. However, the following result makes me question this.

psql -l which returns:
<response>
bash-3.00$ psql -l
ERROR: relation "pg_catalog.pg_user" does not exist
</response>

Hence this led me to try:

create view pg_catalog.pg_user as select pg_shadow.usename,
pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper,
pg_shadow.usecatupd, '********'::text as passwd, pg_shadow.valuntil,
pg_shadow.useconfig from pg_shadow;

<response>
ERROR: permission denied to create "pg_catalog.pg_user"
DETAIL: System catalog modifications are currently disallowed.
</response>

So my question now is how do I enable system catalog modifications.

Thanks in advance.

fred at satcomresources dot com


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 05:25 AM
Tom Lane
 
Posts: n/a
Default Re: Error:PG_DUMP relation pg_user does not exist

Fred Pope <fred.pope@satcomresources.com> writes:
> I am running Postgresql 7.4.7. on RedHat ES-64 version 4 on a
> Dual-Opteron Dual Core system.


> I am having problems with the pg_dump command due to improper
> initialization of the Database cluster on RH ES 4.


Yeah, this is a known problem in some earlier releases of the RHEL4
postgres RPMs --- if you tried to run the initdb with SELinux
enforcement enabled, a lot of the init steps fail silently, and
you end up with no pg_user view, nor several other important things.

> <response>
> ERROR: permission denied to create "pg_catalog.pg_user"
> DETAIL: System catalog modifications are currently disallowed.
> </response>


> So my question now is how do I enable system catalog modifications.


Stand-alone backend with -O command-line option.

As soon as you are able to dump your data, I'd recommend redoing
initdb with SELinux off (or update to a newer RPM which works around
the problem, then initdb).

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:36 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com