From: sad <sad@bankir.ru>
To: KÖPFERL Robert <robert.koepferl@sonorys.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: Single row tables
Date: Wed, 12 Jan 2005 09:39:59 +0300
Message-ID: <200501120939.59489.sad@bankir.ru> (raw)
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB1653A@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB1653A@neptun.sonorys.at>
On Tuesday 11 January 2005 17:45, KÖPFERL Robert wrote:
> Hi,
>
> with what constraint or how can I ensure that one of my tables has exact
> 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 you
define UNIQUE INDEX on a field of this (user-defined) type.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sad@bankir.ru, robert.koepferl@sonorys.at
Subject: Re: Single row tables
In-Reply-To: <200501120939.59489.sad@bankir.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox