| From: | nobody <nobody(at)developer(dot)pgadmin(dot)org> |
|---|---|
| To: | pgsql-www(at)postgresql(dot)org |
| Subject: | Comment 1987 added to page ddl-inherit.html of version 7.4 |
| Date: | 2005-01-13 12:40:44 |
| Message-ID: | 200501131240.j0DCeisu011482@developer.pgadmin.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-www |
Author: Diego Zuccato <diego(at)otello(dot)alma(dot)unibo(dot)it>
----
Replicating PRIMARY KEY in child tables allows only referencing 'em from other tables. It doesn't solve the "duplicated primary key" problem in the parent table. The only way I could find is adding :
CREATE OR REPLACE FUNCTION base_notexists(integer)
RETURNS boolean
STABLE
LANGUAGE 'SQL'
AS 'SELECT NOT EXISTS(SELECT id FROM base WHERE id=$1)';
and the constraint
CHECK (base_notexists(id))
If only it could be possible to reference an already existing index...
----
Manual page: http://wwwmaster.postgresql.org/docs/7.4/interactive/ddl-inherit.html
Reject: http://wwwmaster.postgresql.org/admin/comments.php?action=reject&id=1987
Edit: http://wwwmaster.postgresql.org/admin/comment-edit.php?id=1987
Delete: http://wwwmaster.postgresql.org/admin/comments.php?action=delete&id=1987
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Dave Page | 2005-01-13 13:02:25 | FTP/Mirror selection |
| Previous Message | John Hansen | 2005-01-13 08:43:31 | Re: Search |