Re: best way to reference tables

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: <tjo(at)acm(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: best way to reference tables
Date: 2005-08-09 14:52:32
Message-ID: BF1E3B70.C035%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/9/05 10:31 AM, "TJ O'Donnell" <tjo(at)acm(dot)org> wrote:

> I have many different tables that I want to keep track of.
> So, I thought of a master table with those table names in it.
> But, to maintain this (suppose a table changes
> its name, gets dropped) I want to have some kind of referential
> integrity - the way foreign keys and constraints do.
> What could I use that would disallow inserting a name into
> the master table unless another table by that name already exists?
> And what could ensure that a table would not be renamed or dropped
> unless the master table is changed?

Good idea, but the table already exists. Try:

Select * from pg_tables;

And see:

http://www.postgresql.org/docs/8.0/interactive/catalogs.html

Sean

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-08-09 14:54:38 Re: best way to reference tables
Previous Message Richard Huxton 2005-08-09 14:49:58 Re: Database syncronization