Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

postgresql dump problem

Options
  • 10-05-2007 9:23am
    #1
    Registered Users Posts: 7,678 ✭✭✭


    I am trying to do an postgresql dump for a complete db.

    I am doing is
    pg_dump aap > db.sql;
    
    

    I have tried this inside and outside the aap database but I am always getting the following error

    syntax error at or near pg_dump

    Can anyone know why this is happening??

    Thanks


Comments

  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    Umm, at a guess, remove the ; at the end?

    Documentation here.


  • Registered Users Posts: 568 ✭✭✭phil


    That sounds like you're trying it when you're actually inside the PostgreSQL command prompt.

    pg_dump is an application, it's not an SQL keyword in PostgreSQL.

    So basically you need to run pg_dump at the shell prompt, not once connected to PostgreSQL.

    If you're connecting to PostgreSQL through psql, you'll be passing arguments like hostname, username, password etc. You need to do the same for pg_dump

    e.g.

    pg_dump -U <user> -h <host> -W <dbname>

    This is an example of course and you need to pick the arguments that suit your configuration.

    Phil.


Advertisement