i'm trying to add the ability to dump our database as a backup in case things go wrong with the db server, and so i'm trying to test things now so that if/when things do go bad, i'm not scrambling then :) as a test, i'm just trying to dump a database's schema and restore that ... but it seems like pg_dump doesnt dump things in order so when i restore the dump, i get bunches of errors about things not existing ... looking at the actual dump, i can see the tables pg_restore is complaining about have operations run on it before the actual CREATE sql ... $ pg_dump -F c -s -d database-server mydb > mydb.schema $ psql -d mydb < mydb.schema <error about users_idx not existing> $ grep users_idx mydb.schema INSERT INTO users_idx (.... UPDATE users_idx SET ... -- Name: users_idx; Type: TABLE; ... CREATE TABLE users_idx (... err, shouldnt that CREATE be first ? -mike