Alex Rivera | Logout

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

Asked 2010-09-10T07:24:24.593
308

Is there a way to create a backup of a single table within a database using postgres? And how? Does this also work with the pg_dump command?

Edit
Report

1 Answer

413

Use --table to tell pg_dump what table it has to backup:

pg_dump --host localhost --port 5432 --username postgres --format plain --verbose --file "<abstract_file_path>" --table public.tablename dbname
answered 2010-09-10T07:39:00.987

Your Answer