0

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 ?

10
  • pg_dumpall will dump the entire cluster so you don't need the -d . If you only want the kd database then pg_dump -U sce -h localhost -p 5450 -d kd > /tmp/db.sql and then pg_dumpall -U sce -h localhost -p 5450 -g > pg_globals.sql to get the cluster globals e.g. roles and tablespaces. Commented Jun 8, 2022 at 21:25
  • the same problem Commented Jun 8, 2022 at 21:26
  • Is -U sce a superuser? The user dumping the database(s) has to have sufficient privileges to access all the objects in the database(s). Commented Jun 8, 2022 at 21:31
  • I get the message "pg_dumpall: query was: SELECT oid, rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolconnlimit, rolpassword, rolvaliduntil, rolreplicat ion, pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, rolname = cur rent_user AS is_current_user FROM pg_authid ORDER BY 2" Commented Jun 8, 2022 at 21:34
  • sce is the user that have access to database Commented Jun 8, 2022 at 21:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.