Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

postgresql dump problem

  • 10-05-2007 09:23AM
    #1
    Registered Users, Registered Users 2 Posts: 8,568 ✭✭✭


    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, Registered Users 2 Posts: 23,202 ✭✭✭✭Tom Dunne


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

    Documentation here.


  • Registered Users, Registered Users 2 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