Dylan Hansen
2006-06-23 17:43:06 UTC
Greetings everyone,
Since we've started using the pg_autovacuum table we've come to
realize that keeping OID values between our database dumps is
critical. I've been doing some testing using the pg_dump command
with the --oids option. For some reason, it doesn't seem like the
the OID values are being dumped, because when I restore the dump into
a different database I find that the OID values for my tables are
different.
As a test, I did the following:
createdb testdb1
psql -c "create table mytest(words varchar)" testdb1
psql -c "select oid from pg_class where relname = 'mytest'" testdb1
oid = 52178917
pg_dump -f testdb.sql --oids testdb1
createdb testdb2
psql testdb2 < testdb.sql
psql -c "select oid from pg_class where relname = 'mytest'" testdb2
oid = 52178923
As you can see, the OID values are different in each database.
Looking at the SQL dump I do not see any information related to OIDs.
I also tried using pg_dump with the "-F c" and "-F t" parameter,
using the pg_restore command and I see the same result. I've tested
with PostgreSQL 8.1.3 on Mac OSX as well as PostgreSQL 8.1.4 on RHEL-3.
Is this a bug or is this feature not supported anymore? Thanks for
any input!
--
Dylan Hansen
Enterprise Systems Developer
Since we've started using the pg_autovacuum table we've come to
realize that keeping OID values between our database dumps is
critical. I've been doing some testing using the pg_dump command
with the --oids option. For some reason, it doesn't seem like the
the OID values are being dumped, because when I restore the dump into
a different database I find that the OID values for my tables are
different.
As a test, I did the following:
createdb testdb1
psql -c "create table mytest(words varchar)" testdb1
psql -c "select oid from pg_class where relname = 'mytest'" testdb1
oid = 52178917
pg_dump -f testdb.sql --oids testdb1
createdb testdb2
psql testdb2 < testdb.sql
psql -c "select oid from pg_class where relname = 'mytest'" testdb2
oid = 52178923
As you can see, the OID values are different in each database.
Looking at the SQL dump I do not see any information related to OIDs.
I also tried using pg_dump with the "-F c" and "-F t" parameter,
using the pg_restore command and I see the same result. I've tested
with PostgreSQL 8.1.3 on Mac OSX as well as PostgreSQL 8.1.4 on RHEL-3.
Is this a bug or is this feature not supported anymore? Thanks for
any input!
--
Dylan Hansen
Enterprise Systems Developer