Friday, June 12, 2015

exporting schema's create tables only from postgres

I wanted to export only the CREATE TABLEs from a postgresql database, so I did

pg_dump -h HOST -s databasename -O -U user -W | awk 'RS="";/CREATE TABLE[^;]*;/' 

No comments:

Post a Comment