X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F27B3528D0 for ; Tue, 14 Jun 2005 08:34:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32893-01 for ; Tue, 14 Jun 2005 11:34:24 +0000 (GMT) Received: from s001.mxhosting.nl (unknown [213.206.92.11]) by svr1.postgresql.org (Postfix) with ESMTP id 6111D528BB for ; Tue, 14 Jun 2005 08:34:23 -0300 (ADT) Received: from pinbizz.xs4all.nl ([82.92.94.47] helo=[192.168.11.224]) by s001.mxhosting.nl with asmtp (Exim 4.40 (FreeBSD)) id 1Di98H-0007Uf-4V for pgsql-sql@postgresql.org; Tue, 14 Jun 2005 12:59:01 +0200 Message-ID: <42AEC0C1.7090305@dltmedia.nl> Date: Tue, 14 Jun 2005 13:34:25 +0200 From: "M.D.G. Lange" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: foreign key on pg_shadow Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - s001.mxhosting.nl X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [26 6] X-AntiAbuse: Sender Address Domain - dltmedia.nl X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/162 X-Sequence-Number: 21763 Dear list, Upon designing our application we thought that the following setup would be a good idea to implement security: Using the pg_shadow table as it is: | pg_shadow | +-------------+ | usename | | usesysid | | usecreatedb | | usesuper | | usecatupd | | passwd | | valuntil | | useconfig | We also wanted an extension on it tblusersettings: | tblusersettings | +-----------------+ | userid | | language | | address | | birthdate | | department | | etc... | Where userid should reference to pg_shadow.usesysid. Making it so, that the usersettings for a user would be deleted on a DROP USER. So I tried to create a foreign key constraint with ON DELETE CASCADE. No matter what ON DELETE constraint I created, the system will not allow me to create a foreign key, as pg_shadow is a system catalog. Yet using the database user with this extention would be awesome. I could try to inherit the table, altough I am not certain if that would be allowed... Anyway: is there a way to get this setup working, or should I give up and try it completely different? I am using PostgreSQL 8.0.3 TIA, Michiel