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-
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`