From: | KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at> |
---|---|
To: | |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | RE RE: Single row tables |
Date: | 2005-01-13 11:39:46 |
Message-ID: | ED4E30DD9C43D5118DFB00508BBBA76EB16546@neptun.sonorys.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)bankir(dot)ru]
> Sent: Mittwoch, 12. Jänner 2005 07:40
> To: KÖPFERL Robert
> Cc: pgsql-sql(at)postgresql(dot)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.
>
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Sullivan | 2005-01-13 12:05:49 | Re: Syntax error while altering col-type |
Previous Message | Dawid Kuroczko | 2005-01-13 11:31:20 | Re: Columns into rows. |