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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

postgresql dump problem

  • 10-05-2007 8:23am
    #1
    Registered Users, Registered Users 2 Posts: 7,989 ✭✭✭


    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,212 ✭✭✭✭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