PostgreSQL pg_dump syntax error in Ubuntu

前端 未结 1 740
醉酒成梦
醉酒成梦 2021-01-28 03:07

In ubuntu 16.04 when i want to run pg_dump it doesn\'t work i got this error syntax error. What is wrong ?

postgres=# pg_dump db_name > db_name1.sql
postgres-         


        
1条回答
  •  孤街浪徒
    2021-01-28 03:31

    pg_dump is not an SQL command.

    It is a stand-alone utility, so you cannot run it from SQL query. Follow the link for more information.

    For your case: type \q to quit from SQL-client and repeat your command again using shell prompt. Remember you should use your SQL-credentials. I.e.:

    $ pg_dump -U  db_name > db_name1.sql`
    

    0 讨论(0)
提交回复
热议问题