Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A35B64753A1 for ; Tue, 6 Aug 2002 23:52:28 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 1915A474E44 for ; Tue, 6 Aug 2002 23:52:28 -0400 (EDT) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1603081; Tue, 06 Aug 2002 20:52:31 -0700 From: "Josh Berkus" Subject: Re: Limit A Table To 1 Row To: , X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Tue, 06 Aug 2002 20:52:31 -0700 Message-ID: In-Reply-To: <200208070329.32fc@th00.opsion.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/125 X-Sequence-Number: 8971 Cnliou, > Corporate table, t1, should contain exact 1 row. > I strongly believe that there are cleaner versions > than the following combination of trigger and rule. Actually, your method looks quite effective and relatively simple. However, you may want to reconsider this method of storing values in the database. What I do is create a table called global_admin: CREATE TABLE global_admin ( value_name VARCHAR(30) NOT NULL PRIMARY KEY, value_format VARCHAR(30) NOT NULL, admin_value TEXT NULL ); And then I can store all of my random, persistent setting data in one table: value_name value_format admin_value 'Coporation' 'Text' 'Lugini Corp., Inc.' 'Home Town' 'Text' 'Singapore' 'Timeout Interval' 'Interval' '30 minutes' 'Max Reports' 'Integer' '5' etc. -Josh Berkus