Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    2

    Unanswered: pg_dump: SQL command failed

    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 = 'dabname'

    I got this errr while backup the database schema using pg_dump.
    Can anybody suggest some remedies????

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Could you post the actual command(s) that you entered when invoking pg_dump?
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Jan 2008
    Posts
    2

    Command i gave

    pg_dump -Ft kau_fresh -Upostgres -O -x -h localhost -p5432>kau_fresh.tar

    This is the command i gave.

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Maybe you've removed the system view called pg_user. (A good reason for not logging on with superuser access!)

    When using pg_admin, under the 'View' menu, make sure that the System Objects menu item is checked.

    Refresh the object browser if needed.

    In your database, open the pg_catalog schema, and then open Views, and finally, check to see that view pg_user is present. If it is, right-click it, select the Scripts, CREATE script menu.

    The result should be
    Code:
    -- View: "pg_user"
    
    -- DROP VIEW pg_user;
    
    CREATE OR REPLACE VIEW 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;
    
    ALTER TABLE pg_user OWNER TO postgres;
    GRANT SELECT ON TABLE pg_user TO public;
    If it isn't, you'll probably need to re-create the view...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •