Re: Are globally defined constants possible at all ?

From: Gregory Seidman <gss+pg(at)cs(dot)brown(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Are globally defined constants possible at all ?
Date: 2002-06-07 21:29:27
Message-ID: 20020607212927.GA25261@jamaica.cs.brown.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Sullivan sez:
} 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.

Er, could you expand on that? Are you suggesting something like this:

CREATE TABLE Foo (
KindID int,
...
CONSTRAINT fooenum
CHECK KindID IN ('SOFTWARE', 'HARDWARE')
);

} A
--Greg

In response to

Responses

Browse pgsql-general by date

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