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 680DD3A5BD7 for ; Wed, 12 Jan 2005 06:38:50 +0000 (GMT) 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 53772-01 for ; Wed, 12 Jan 2005 06:38:39 +0000 (GMT) Received: from mx.antora.ru (bankir3.bankir.ru [213.234.216.238]) by svr1.postgresql.org (Postfix) with ESMTP id 2D0083A5C08 for ; Wed, 12 Jan 2005 06:38:39 +0000 (GMT) Received: from [83.239.23.194] (helo=sad.localnet.ru) by mx.antora.ru with esmtpa (Exim 4.42 (FreeBSD)) id 1Coc9J-000AhP-VT; Wed, 12 Jan 2005 09:38:34 +0300 Content-Type: text/plain; charset="iso-8859-1" From: sad Organization: IT To: =?iso-8859-1?q?K=D6PFERL=20Robert?= Subject: Re: Single row tables Date: Wed, 12 Jan 2005 09:39:59 +0300 User-Agent: KMail/1.4.3 Cc: pgsql-sql@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200501120939.59489.sad@bankir.ru> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/51 X-Sequence-Number: 19839 On Tuesday 11 January 2005 17:45, K=D6PFERL Robert wrote: > Hi, > > with what constraint or how can I ensure that one of my tables has exac= t > one record or 0..1 records? A trigger procedure BEFORE INSERT would help you. And a column type with only one possible field value would help you if yo= u=20 define UNIQUE INDEX on a field of this (user-defined) type.