oids

Started by Bob Pawleyabout 18 years ago6 messagesgeneral
Jump to latest
#1Bob Pawley
rjpawley@shaw.ca

I'm running Postgresql 8.2 on Windows.

If I create a table 'without oids' are oids still in use behind the scenes??

Bob

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Bob Pawley (#1)
Re: oids

On Mon, Feb 11, 2008 at 10:15:40AM -0800, Bob Pawley wrote:

I'm running Postgresql 8.2 on Windows.

If I create a table 'without oids' are oids still in use behind the scenes??

Nope.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Those who make peaceful revolution impossible will make violent revolution inevitable.
-- John F Kennedy

#3Erik Jones
erik@myemma.com
In reply to: Bob Pawley (#1)
Re: oids

On Feb 11, 2008, at 12:15 PM, Bob Pawley wrote:

I'm running Postgresql 8.2 on Windows.

If I create a table 'without oids' are oids still in use behind the
scenes??

Yes and no. WITHOUT OIDS specifies that you don't want each row to
get its own oid. You will often here of "a table's oid" and what
that is is the oid of the pg_class entry for that table. The default
when creating tables is WITHOUT OIDS and you should leave it that way.

Erik Jones

DBA | Emma®
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

#4Bob Pawley
rjpawley@shaw.ca
In reply to: Bob Pawley (#1)
Re: oids

All of my tables are without oids.

I have an application in which I drop, then recreate a table (to reset
serial numbers) and with an update on the new information I get an error
about a specific oid missing.

Any thoughts would be appreciated.

Bob
----- Original Message -----
From: "Erik Jones" <erik@myemma.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "PostgreSQL" <pgsql-general@postgresql.org>
Sent: Monday, February 11, 2008 10:29 AM
Subject: Re: [GENERAL] oids

On Feb 11, 2008, at 12:15 PM, Bob Pawley wrote:

I'm running Postgresql 8.2 on Windows.

If I create a table 'without oids' are oids still in use behind the
scenes??

Yes and no. WITHOUT OIDS specifies that you don't want each row to
get its own oid. You will often here of "a table's oid" and what
that is is the oid of the pg_class entry for that table. The default
when creating tables is WITHOUT OIDS and you should leave it that way.

Erik Jones

DBA | Emma�
erik@myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

#5Andrew Sullivan
ajs@crankycanuck.ca
In reply to: Bob Pawley (#4)
Re: oids

On Mon, Feb 11, 2008 at 10:38:55AM -0800, Bob Pawley wrote:

All of my tables are without oids.

I have an application in which I drop, then recreate a table (to reset
serial numbers) and with an update on the new information I get an error
about a specific oid missing.

Any thoughts would be appreciated.

Your application has the plan for accessing that table cached, and the way
the access happens "under the hood" is by the oid of the table. This is the
"table oid" that someone upthread was mentioning.

There's probably a less kludgey way of resetting serial numbers. Is this a
sequence? What's wrong with setval()?

A

#6Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Bob Pawley (#4)
Re: oids

Bob Pawley wrote:

All of my tables are without oids.

I have an application in which I drop, then recreate a table (to reset
serial numbers) and with an update on the new information I get an error
about a specific oid missing.

This is a known problem. It was fixed in 8.3 -- you may want to try
that.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support