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 86B503A4FDB for ; Thu, 13 Jan 2005 11:40:06 +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 28903-02 for ; Thu, 13 Jan 2005 11:39:50 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id 137173A5BE6 for ; Thu, 13 Jan 2005 11:39:52 +0000 (GMT) Received: (qmail-ldap/ctrl 35194 invoked from network); 13 Jan 2005 11:39:50 -0000 Received: from unknown (HELO jupiter.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 13 Jan 2005 11:39:50 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by jupiter.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j0DBe0s16497 for ; Thu, 13 Jan 2005 12:40:00 +0100 (MET) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Thu, 13 Jan 2005 12:39:52 +0100 Message-ID: From: =?iso-8859-1?Q?K=D6PFERL_Robert?= To: Cc: pgsql-sql@postgresql.org Subject: RE RE: Single row tables Date: Thu, 13 Jan 2005 12:39:46 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200501/80 X-Sequence-Number: 19868 The first seems like an appropriate solution. Fireing a = trigger-function that returns null. If I however try to implement a function getnull in sql I fail. = Defining the trigger requests a function of type trigger while definition of a = function forbids using trigger as return type. So RTFM - there's however just an example for C. I don't want to engage the compiler.... :-/ > -----Original Message----- > From: sad [mailto:sad@bankir.ru] > Sent: Mittwoch, 12. J=E4nner 2005 07:40 > To: K=D6PFERL Robert > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] Single row tables >=20 >=20 > On Tuesday 11 January 2005 17:45, K=D6PFERL Robert wrote: > > Hi, > > > > with what constraint or how can I ensure that one of my=20 > tables has exact > > one record or 0..1 records? >=20 > A trigger procedure BEFORE INSERT would help you. >=20 > And a column type with only one possible field value would=20 > help you if you=20 > define UNIQUE INDEX on a field of this (user-defined) type. >=20