pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>
To: pgsql-sql@postgresql.org
Subject: check constraint  bug?
Date: Fri, 6 May 2011 06:06:08 +0100
Message-ID: <20110506060608.12bd24b0@dick.coachhouse> (raw)

I specified:

ALTER TABLE h ADD CONSTRAINT val_h_stats
CHECK (NOT (sex = 'f') AND (stats IS NOT NULL));

which was translated to:

ALTER TABLE h ADD CONSTRAINT val_h_stats 
CHECK (NOT sex = 'f'::bpchar AND stats IS NOT NULL);


Can the expression not be bracketed?


I changed this to:
ALTER TABLE horse ADD CONSTRAINT val_horse_stats
CHECK (sex != 'f') OR (stats IS NULL));


-- 

Best Regards,
Tarlika Elisabeth Schmitz



view thread (3+ messages)  latest in thread

Message-ID: <20110506060608.12bd24b0@dick.coachhouse>
Permalink:  ../20110506060608.12bd24b0@dick.coachhouse/
Also on:    postgresql.org/message-id/20110506060608.12bd24b0@dick.coachhouse

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: postgresql3@numerixtechnology.de
  Subject: Re: check constraint  bug?
  In-Reply-To: <20110506060608.12bd24b0@dick.coachhouse>

* 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