Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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" –  Jurgen Cuschieri May 29 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. –  Craig Ringer May 29 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? –  Jurgen Cuschieri May 29 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". –  Craig Ringer May 29 at 1:20
    
thanks managed! from the dump options, what options do you recommend choosing? –  Jurgen Cuschieri May 29 at 1:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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