Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two systems running, one on linux and the other on windows. From the linux box, I ran pg_dump against both systems and dumped the schema.

pg_dump command:

pg_dump -h HOST -U USER -s -f /tmp/out.sql DB_NAME

After I removed all of the "--" comments, I diffed the files together.

Diff output snippet, linux compared to windows:

-    ADD CONSTRAINT sys_c004775 FOREIGN KEY (ruleid) REFERENCES rule(ruleid);
+    ADD CONSTRAINT sys_c004775 FOREIGN KEY (ruleid) REFERENCES "rule"(ruleid);

The linux dump does not quote any entities and windows does. Is this a function of some encoding or just of a difference between windows and linux? Is there an option in pg_dump to make the output more consistent?

share|improve this question
add comment

1 Answer

It's rather strange but both lines are correct and will work in any PostgreSQL-database on any OS. "rule" isn't a reserved word, but it is an object type in PostgreSQL. That might be the reason why some version of pg_dump treats this name different. If you realy need unquoted names, just use another name, a name without any conflicts with object types what so ever.

share|improve this answer
    
This isn't much help since I can't change anything about the schema. The databases are not the same version, 8.4.3 on linux, 8.2 on windows. Perhaps this is the problem? –  Jonathan May 26 '10 at 15:15
    
And did you use the same pg_dump-version to create the backups? pg_dump version 8.4 can also create backups of an 8.2-database. Using different databases is asking for trouble, an 8.4-backup might not work in a 8.2-databaseserver. Be careful! –  Frank Heikens May 27 '10 at 8:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.