Dump / Restore

Dump All Functions (to a file)

SELECT pg_get_functiondef(f.oid) FROM pg_catalog.pg_proc f
INNER JOIN pg_catalog.pg_namespace n ON (f.pronamespace = n.oid)
WHERE n.nspname = 'public';

Dump database

pg_dump -U username -h hostname databasename > dump.sql

Import info existing database

psql -d newdb -f dump.sql

Dump and Restore Sperling Database

pg_dump --no-owner -U sperling_prod -h mimir1.aco.net sperling_prod > dump.sql

psql -h localhosst sperling_devel postgres -f dump.sql

Revision #2
Created 30 March 2021 10:18:08 by Liviu
Updated 30 March 2021 10:18:54 by Liviu