pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: KÖPFERL Robert <robert.koepferl@sonorys.at>
Cc: pgsql-sql@postgresql.org
Subject: RE RE: Single row tables
Date: Thu, 13 Jan 2005 12:39:46 +0100
Message-ID: <ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at> (raw)

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änner 2005 07:40
> To: KÖPFERL Robert
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] Single row tables
> 
> 
> 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.
> 



Message-ID: <ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at>
Permalink:  ../ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at/
Also on:    postgresql.org/message-id/ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: robert.koepferl@sonorys.at
  Subject: Re: RE RE: Single row tables
  In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at>
  References: <ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at>

* 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