1

I create a backup file of postgeSQL database:

>pg_dump --dbname=db_test --host=localhost --username=user -F c -f dump_test.out

In documentation for pg_dump is used extension .sql and for pg_dumpall is used .out

https://www.postgresql.org/docs/9.2/app-pgdump.html

https://www.postgresql.org/docs/9.2/app-pg-dumpall.html

What is the differences between the extensions of .out and .sql in pg_dump in PostgreSQL? what is the recommendation and why?

asked Apr 8, 2020 at 16:43

1 Answer 1

4

Actually in these examples the used extensions don't really matter: both exports are plain text (i.e SQL) scripts. You decide which extension to use: if you export in plain SQL it's better to use .sql extension but you can choose another one.

In general you decide which extension you use. Neither psql nor pg_restore have a mandatory extension for the export file. If you use another output file format (-Fc or -Ft) for pg_dump it's better to use another extension than .sql to remember which export format has been used.

answered Apr 8, 2020 at 17:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.