hg addhg inithg commit -m "Nachricht"
@echo off
REM Parameter abpruefen
if "%1" == "" (
echo Bitte DB-Name angeben
goto end
)
REM sammeln der Tabellennamen aus Schema public
psql -U postgres -d %1 -t -c "SELECT tablename FROM pg_tables WHERE schemaname = 'public'" > tables.list
REM sortieren und sortierung speichern
sort tables.list /O tables.list
REM jede Tabelle einzeln sichern
for /F %%f IN (tables.list) do (
psql -U postgres -d %1 -c "COPY %%f to STDOUT" > %%f.copy
REM sortieren (nach erster Tabellenspalte)
sort %%f.copy /O %%f.copy
)
REM das wars schon
:end
PAUSEtype tabelle.copy | psql -U postgres -d <db-name> -c "COPY <tabelle> FROM STDIN"
