| From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> | 
|---|---|
| To: | elein <elein(at)varlena(dot)com> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: referencing system catalogs | 
| Date: | 2004-06-27 01:13:06 | 
| Message-ID: | 20040626180235.I81933@megazone.bigpanda.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On Sat, 26 Jun 2004, elein wrote:
> Can someone explain the reasoning behind not allowing
> a user table to contain a foreign key of a system table?
>
> For example:
>
> create table myusers (
> 	login	text	references pg_catalog.pg_shadow(usename),
> 	...
> );
>
> Fails with a message about using system catalogs.
> Using pg_user fails because it is a view and not a table.
>
> Is it because updates to the catalogs can be done outside
> of transactions?  Is that a good enough reason?
I believe it's because changes to at least some of the system catalogs can
be done without going through the entire sequence that an
update/insert/delete statement would (ie, the triggers might not be
fired thus meaning the constraint isn't properly checked).
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Scott Marlowe | 2004-06-27 01:36:13 | Re: Performance problem on RH7.1 | 
| Previous Message | elein | 2004-06-27 00:31:11 | referencing system catalogs |