By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,776 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,776 IT Pros & Developers. It's quick & easy.

Reset oid , starting value=1

P: n/a
Hello,
i have a bug in a php application based on postgres 7.2.2 , which cannot
handle oid's greater than
2147483647 .
So I have to reset the used oids to start from 1 again, so that we have more
time to correct this bug, I tried to delete dropdb, createdb and read back
the data, but the oids are not reseted , they start at the high values.
How can i reset this oid-starting from value ?
Are OIDs used once per postgres-installation (so they are unique over all
databases, seem to be that way) , or are they only counted up in the current
database ?
There must be a global value which sets the last oid, i need to set this to
"1" or to fill up from 1 , so i have no oids >= 2147483647 for the near
future.. how can i do this ? Fixing the mentioned above will take more time.

What i am looking for is a vacuumdb -a --forgetthoseoids ;-) , but I cannot
find infos about that.

bye,
Andre Gellert

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The only way to reset oids is to destroy the entire data directory and
initdb again. In recent versions you can create tables without oids, thus
reducing their usage.

Hope this helps,

On Tue, Dec 09, 2003 at 11:22:15AM +0100, Gellert, Andre wrote:
Hello,
i have a bug in a php application based on postgres 7.2.2 , which cannot
handle oid's greater than
2147483647 .
So I have to reset the used oids to start from 1 again, so that we have more
time to correct this bug, I tried to delete dropdb, createdb and read back
the data, but the oids are not reseted , they start at the high values.
How can i reset this oid-starting from value ?
Are OIDs used once per postgres-installation (so they are unique over all
databases, seem to be that way) , or are they only counted up in the current
database ?
There must be a global value which sets the last oid, i need to set this to
"1" or to fill up from 1 , so i have no oids >= 2147483647 for the near
future.. how can i do this ? Fixing the mentioned above will take more time.

What i am looking for is a vacuumdb -a --forgetthoseoids ;-) , but I cannot
find infos about that.

bye,
Andre Gellert

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
--
Martijn van Oosterhout <kl*****@svana.org> http://svana.org/kleptog/ (... have gone from d-i being barely usable even by its developers
anywhere, to being about 20% done. Sweet. And the last 80% usually takes
20% of the time, too, right?) -- Anthony Towns, debian-devel-announce


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/1a9rY5Twig3Ge+YRAkoQAKDXiqiQsIfhyPAk2azm1jLPCEQuyg CePtNV
LeH2LBrWp37Nskr35b6Liek=
=z7bj
-----END PGP SIGNATURE-----

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.