## page was renamed from Computerkram/Postgresql = Postgresql = == Backup == parallel: {{{ # Starte den Dump, Dump wird in $DUMP_FILE umgeleitet, Fehler in $PG_DUMP_ERR pg_dump -Fd -T measure_lastupdate -T measurement_temp1 -T measurement_temp2 -f ${DUMP_FILE} -j 4 -U postgres --no-password ${DB_SCHEMA} 2> $PG_DUMP_ERR EXITCODE=$? echo "Schema exportieren" pg_dump -F d -s -f ${DUMP_FILE}.schema -U postgres --no-password ${DB_SCHEMA} 2>> $PG_DUMP_ERR EXITCODE_SCHEMA=$? mv ${DUMP_FILE}/toc.dat ${DUMP_FILE}/toc.dat.orig cp ${DUMP_FILE}.schema/toc.dat ${DUMP_FILE}/toc.dat rm -r ${DUMP_FILE}.schema }}} == Restore == * Datenbank anlegen * createdb dbname * Import des Dumps * pg_restore -d dbname -j 4 dir/