0

I have a final year project written in Matlab in conjunction to a postgresql database called 'hm'.

I asked in which way could I submit the database and I was told to perform a back up of the database using pgadmin3.

What is the recommended format? I want the person to be correcting the assignment to be able to use my own database in his own postgresql version. Which format and options should I check to ensure that they can work with the backup?

I am using postgresql 9.4.

1 Answer 1

1

Use pg_dump -Fc and tell them to load it with pg_restore.

If you've created user accounts and other global objects you'll want to also provide a pg_dumpall --globals-only to them.

6
  • I am a bit of a noob in this area. you do this in SQL Shell (psql) ? I am trying this: $ pg_dump -Fc mydb > db.dump. What should I type when the terminal says: Database(postgres): and Port(5432) ? I tried some inputs but it returns warnings "ignored" May 29, 2015 at 1:00
  • OS command line shell, not psql. pg_dump is a utility program. Use the same connection options as you use for psql. For details see the PostgreSQL manual. May 29, 2015 at 1:02
  • i tried to do it in the terminal but always getting command not found. isnt the backup function in pgadmin convenient? doesn't it do the same thing? perhaps you know which options I could choose to get the same result as the pgdump? May 29, 2015 at 1:14
  • Presumably pg_dump isn't on your PATH; you might need to invoke it with the full path to where it's installed. Also, yes, there is a PgAdmin backup function. You did not mention that you were using PgAdmin. It's documented in the PgAdmin manual. Right click on the database in PgAdmin and choose "backup". May 29, 2015 at 1:20
  • thanks managed! from the dump options, what options do you recommend choosing? May 29, 2015 at 1:25

Your Answer

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

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