Alternative to tableoids?

Started by fkater@googlemail.comabout 18 years ago3 messagesgeneral
Jump to latest
#1fkater@googlemail.com
fkater@googlemail.com

Hi,

what's an alternative to tableoids?

As I've learned today they are not consistant across pg_dump/restore.

I need to point to (lots of dynamically added) tables and used tableoids
before.

Are there other solutions to point to tables besides using tableoids
or wasting disk space using the strings of 'schema' and 'tablename'
everywhere as a reference?

And hints welcome :-)

Felix

#2Richard Huxton
dev@archonet.com
In reply to: fkater@googlemail.com (#1)
Re: Alternative to tableoids?

fkater@googlemail.com wrote:

Hi,

what's an alternative to tableoids?

As I've learned today they are not consistant across pg_dump/restore.

I need to point to (lots of dynamically added) tables and used tableoids
before.

Are there other solutions to point to tables besides using tableoids
or wasting disk space using the strings of 'schema' and 'tablename'
everywhere as a reference?

Are you seriously saying that you have so many tables that storing their
names is a problem?

Anyway, since your code is expecting something that looks like an OID,
why not just build your own, something like:

CREATE TABLE my_sys_object_tracker (
objoid SERIAL,
objschema name NOT NULL,
objname name NOT NULL,

PRIMARY KEY (objoid),
CONSTRAINT unique_obj_name UNIQUE (objschema, objname)
);

--
Richard Huxton
Archonet Ltd

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: fkater@googlemail.com (#1)
Re: Alternative to tableoids?

On Mon, Feb 04, 2008 at 08:12:51PM +0100, fkater@googlemail.com wrote:

what's an alternative to tableoids?

As I've learned today they are not consistant across pg_dump/restore.

I need to point to (lots of dynamically added) tables and used tableoids
before.

Are there other solutions to point to tables besides using tableoids
or wasting disk space using the strings of 'schema' and 'tablename'
everywhere as a reference?

Use regclass, takes the same space as OIDs but works across
dump/restore. For tables anyway (not indexes etc al)

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