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

cancel script completely on ctrl-c

I found this question interesting: basically how to cancel completely a script and all child processes : You do this by creating a subro...