I want to export a postgresql database named "kd" with all roles, tablespaces, etc. I run the command pg_dumpall -U sce -h localhost -p 5450 -d kd > /tmp/db.sql I get the error
pg_dumpall: missing "=" after "kd5" in connection info string
I run the command pg_dumpall -U sce -h localhost -p 5450 > /tmp/db.sql
I get the error
pg_dumpall: query was: SELECT oid, rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolconnlimit, rolpassword, rolvaliduntil, rolreplication, pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, rolname = current_user AS is_current_user FROM pg_authid ORDER BY 2
How can fix this problem ?
pg_dumpallwill dump the entire cluster so you don't need the-d. If you only want thekddatabase thenpg_dump -U sce -h localhost -p 5450 -d kd > /tmp/db.sqland thenpg_dumpall -U sce -h localhost -p 5450 -g > pg_globals.sqlto get the cluster globals e.g. roles and tablespaces.-U scea superuser? The user dumping the database(s) has to have sufficient privileges to access all the objects in the database(s).