Re: Are globally defined constants possible at all ?

From: Darren Ferguson <darren(at)crystalballinc(dot)com>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: Andrew Sullivan <andrew(at)libertyrms(dot)info>, pgsql-general(at)postgresql(dot)org
Subject: Re: Are globally defined constants possible at all ?
Date: 2002-06-07 21:49:41
Message-ID: Pine.LNX.4.10.10206071748430.16196-100000@thread.crystalballinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Check can be used in the following way

status VARCHAR(32) DEFAULT 'new' NOT NULL
CHECK(status IN ('new','read','deleted')),

HTH

Darren Ferguson

On Fri, 7 Jun 2002, Nigel J. Andrews wrote:

>
> On Fri, 7 Jun 2002, Andrew Sullivan wrote:
>
> > On Fri, Jun 07, 2002 at 02:36:35PM -0400, Gregory Seidman wrote:
> >
> > > I am in the exact same position. I have a number of things which are
> > > essentially enumerations. Since PostgreSQL does not support an enumeration
> > > type (MySQL does, but then it doesn't have a proper boolean type), I have a
> >
> > Why don't you use a CHECK contraint? That's the standard way to do
> > it.
>
> I wonder if you could explain how to use CHECK for this please? I'm having a
> little trouble thinking in that manner but then I've only seen and used the
> table associating name and value method before and so am a little biased.
>
>
> --
> Nigel J. Andrews
> Director
>
> ---
> Logictree Systems Limited
> Computer Consultants
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-06-07 22:04:47 Re: Are globally defined constants possible at all ?
Previous Message Nigel J. Andrews 2002-06-07 21:31:48 Re: Are globally defined constants possible at all ?