Re: [SQL] CHECK and IN (Sets in general) - What's the story?

From: Holger Mitterwald <mittehlg(at)coi(dot)de>
To: k_ogorman(at)kompass(dot)ie
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] CHECK and IN (Sets in general) - What's the story?
Date: 1998-08-21 07:30:07
Message-ID: Pine.GSO.4.02.9808210916380.7604-100000@su00574
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 20 Aug 1998 k_ogorman(at)kompass(dot)ie wrote:

> Is there a known reason why the following definition fails
> the parser at the IN keyword?:
>
> create table kev_test ( my_tag char check (my_tag in ('A', 'B', 'C')));

It isn't this worse at all :-)

First, your syntax is not correct.
Second, you can change the 'IN' Clause with several 'OR' clauses.
The result would look like this:

create table kev_test ( my_tag char) constraint tester check (my_tag =
'A' OR my_tag='B' OR my_tag = 'C');

If somebody has a solution for the 'IN' construction.... mail it!

So long,
Holger
--------------------------------------------------------------------------------
Holger Mitterwald COI-D #### ##### ### CONSULTING FUER OFFICE
COI GmbH Herzogenaurach # # # # UND INFORMATION
Industriestrasse 1 - 3 # # # # MANAGEMENT GmbH
D-91074 Herzogenaurach #### ##### ### Tel.: 09132/82-3811

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chauncey Thorn 1998-08-21 12:38:53 SQL statement Problem
Previous Message k_ogorman 1998-08-20 14:12:42 CHECK and IN (Sets in general) - What's the story?