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



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

1 Answer 1


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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.