duplicating a postgresql DB

23 Aug
e.g. for testing purposes before touching valuable data… set the DB names ORIG_DB="orig_db_name" NEW_DB="new_db_name" create a dump (make sure to use a user having access rights to the db) TSTAMP=$(date +%F_%H-%M) FILE_ORIG="${ORIG_DB}_${TSTAMP}.sql" pg_dump -f ${FILE_ORIG} --blobs --create ${ORIG_DB} adjust the...
Read more »