Postgresql – Data missing in PostgreSQL dump

pg-dumppostgresql

I'm trying to verify that I am actually getting data in my pg_dump from a PostgreSQL 9.3 server. I'm specifically running the following to get a dump of my Foreman database:

pg_dump -Fc foreman -U foreman -h foreman-db -p 5432 > foreman.sql

I am reading the dump using pg_restore -l foreman.sql but when I search for known fqdns of hosts that should be in the hosts table, I can not find them.

I'm no DBA, but it seems I'm doing something very wrong or I don't know how to search well enough yet to find data within pg_dump's.

Any assistance is much appreciated.

Best Answer

This turned out to be my own fault and not making sure that the Foreman host had a postgresql93 client installed so that the rake task that imports the database could actually do the pg_restore on the valid dump.

I was able to use pg_dump -Fp to get the plain text and validate that my data was in there. Thank you everyone for your help. Chalk this one up to a newbie trying to learn Postgres.

Cheers.