Re: Is this a bug in the table definition or in PostgreSQL?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is this a bug in the table definition or in PostgreSQL?
Date: 2000-05-04 17:42:12
Message-ID: 24209.957462132@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Oliver Elphick" <olly(at)lfix(dot)co(dot)uk> writes:
> The complicated constraint in this definition of the product table doesn't
> work, but should it? or is there a better way to do this?
> ...
> CONSTRAINT ean CHECK (
> CASE WHEN eancode IS NULL OR brand IS NULL
> THEN 't'
> ELSE ean_checkdigit(
> (SELECT ean_prefix
> FROM brandname
> WHERE brandname.id = brand
> ), eancode)
> END
> )

> copy product from '/rover/avoca/dumps/dbdump.product'
> ERROR: copy: line 2, ExecEvalExpr: unknown expression type 108
> [line 1 had null values in the relevant fields]

108 ... (checks nodes.h) ... SubLink ... looks like your sub-select
isn't getting processed properly. I'd say it's a bug, but it's
probably too late to fix it for 7.0.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-05-04 17:52:25 Re: pg_group_name_index corrupt?
Previous Message Tom Lane 2000-05-04 17:35:16 Re: 7.0RC2 compile error !