Re: Single row tables - Mailing list pgsql-sql

From sad
Subject Re: Single row tables
Date
Msg-id 200501120939.59489.sad@bankir.ru
Whole thread Raw
In response to Single row tables  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
List pgsql-sql
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.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Simple Question
Next
From: KÖPFERL Robert
Date:
Subject: Implementing queue semantics (novice)