Wednesday, July 30, 2014

How to create a backup of a single table in a postgres database?



C:\Program Files\PostgreSQL\9.0\bin\pg_dump.exe --host localhost --port 5432 --username postgres --format plain --ignore-version --verbose --file "C:\temp\filename.backup" --table public.tablename dbname
Use --table to tell pg_dump what table it has to backup. On Linux:
pg_dump -h localhost -p 5432 -U postgres -F c -i -v -f "/home/ssaret/table_name.backup" -t schema.table_name postgres

No comments:

Post a Comment