1. Check Available Databases: Confirm that the database you want to write to is present. You can check the databases available in your PostgreSQL instance using:
\l
  1. Connect to the Database: Connect to the my_db database using:
\c my_db
  1. Check Schemas: Check the schemas in the my_db database using:
\dn
  1. Install PostGIS Extension: Run the following command to ensure the PostGIS extension was available in your my_db database:
CREATE EXTENSION IF NOT EXISTS postgis;

This will successfully install PostGIS, enabling spatial data types like geometry.

  1. Restore the Backup: The restore command to bring back the data from the backup:
pg_restore -U postgres -d nyc /tmp/data/nyc_data.backup
  1. Verify the Tables: After the restore, you can use the following to list the tables in the public schema:
\dt public.*

Confirm that the tables from your backup were restored correctly.