Re: Single row tables

From: sad <sad(at)bankir(dot)ru>
To: KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Single row tables
Date: 2005-01-12 06:39:59
Message-ID: 200501120939.59489.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message KÖPFERL Robert 2005-01-12 13:54:25 Implementing queue semantics (novice)
Previous Message Tom Lane 2005-01-11 22:43:20 Re: Simple Question