Reputation: 26748
I have full dump of sql file like dump_full.sql
of size 1.3GB
And it has some tables like
dancing_core_spice
dancing_sea_beast
forde_clear_one
forde_super_now
Now what i want is need to restore/fetch/dump only data
of these tables from dump_full.sql
file
psql -U postgres --table=dancing_core_spice dump_full.sql > dancing_core_spice.sql
i tried the above command but it is not working
So can anyone please let me know how to take the dump of only single table from the sql file(full dump)
Upvotes: 2
Views: 13182
Reputation: 25178
For these type of operations the dump file should be in the postgresql custom format created with pg_dump:
pg_dump -Fc
Then you can restore a single table with pg_restore
pg_restore --table=dancing_core_spice dump_full.sql > dancing_core_spice.sql
This question provides tips to handle your actual case:
Upvotes: 2