Skip site navigation (1) Skip section navigation (2)

Re: using system catalogs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mija Lee <mija(at)scharp(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: using system catalogs
Date: 2007-08-29 18:53:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Mija Lee <mija(at)scharp(dot)org> writes:
> - I can create another table with a field that matches the datname in
> pg_database and try to write a trigger that inserts into my table when
> a record is inserted into pg_database, but I have the feeling that may
> also be a dead end.

Yup, because we don't support firing triggers on system catalogs.
There are conceptual, security, and implementation reasons why not;
troll the pghackers archives for discussions.

> On a related note, I'm also trying to find the system table that links
> database oids with table or schema oids, but I can't seem to find
> it. I know it's there somewhere, but don't see it in the doc.

You don't see it because it's not there.  pg_class and so forth live
within a database, that is, there's a physically separate version in
each database; so the database ID is implicit.  There are actually only
a few system catalogs that don't work that way --- they are the ones we
call "shared".

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Michael GlaesemannDate: 2007-08-29 19:58:05
Subject: Re: using system catalogs
Previous:From: Mija LeeDate: 2007-08-29 18:26:16
Subject: using system catalogs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group