You can skip the full restore and take the table straight out of the `.sql` file.
Disclosure: I work on this tool. The free [PostgreSQL Dump Viewer](https://streams.dbconvert.com/postgresql-dump-viewer) opens the dump in a browser tab; nothing is uploaded.
1. Open `site_prod.sql` and pick `precious_table` in the tree.
2. Click **Export → CSV**
3. Load it back into production:
\copy precious_table FROM 'precious_table.csv' WITH (FORMAT csv, HEADER)
For a multi-gigabyte dump, use the `sed` approach above.
You can skip the full restore and take the table straight out of the gzipped dump.
Disclosure: I work on this tool. The free [PostgreSQL Dump Viewer](https://streams.dbconvert.com/postgresql-dump-viewer) opens the dump in a browser tab; nothing is uploaded.
1. Open `my-db-name-backup.sql.gz` as is and pick your table in the tree.
2. Click **Export → CSV** (first 10,000 rows free).
3. Load it back into the database:
\copy your_table FROM 'your_table.csv' WITH (FORMAT csv, HEADER)
For a multi-gigabyte dump, use the `awk` approach instead.