Re: Alternative to tableoids? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Alternative to tableoids?
Date
Msg-id 47A7716C.4040205@archonet.com
Whole thread Raw
In response to Alternative to tableoids?  ("fkater@googlemail.com" <fkater@googlemail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Josh Berkus
Date:
Subject: Re: [pgsql-advocacy] PostgreSQL Certification -- wind it up, please.
Next
From: Tom Lane
Date:
Subject: Re: "pg_ctl: cannot be run as root"