postgres dump sql insert 1

postgres dump sql insert

sudo -u postgres pg_dump --table=my_table_name --data-only --column-inserts my_db_name

Here is what the above code is Doing:
1. sudo -u postgres: run the following command as the postgres user
2. pg_dump: the PostgreSQL database backup utility
3. –table=my_table_name: only dump the table named my_table_name
4. –data-only: only dump data, not the table schema
5. –column-inserts: dump data as INSERT commands that include column names
6. my_db_name: the name of the database to dump

Similar Posts