Skip site navigation (1) Skip section navigation (2)

Re: BUG #2455: psql failing to restore a table because of a constaint violation.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jeff Ross" <jross(at)wykids(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2455: psql failing to restore a table because of a constaint violation.
Date: 2006-05-26 21:11:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"Jeff Ross" <jross(at)wykids(dot)org> writes:
> After the upgrade to 8.1.4, this script I use to sync a development database
> with our live database began failing.

> Here's the failure:

> psql:/home/_postgresql/wykids20060524.sql:84507: ERROR:  new row for
> relation "Clearinghouse" violates check
> constraint "refnumber_ck"

> Here's the record it barfs on:

> RefNumber         | V207.030

>     "refnumber_ck" CHECK ("RefNumber"::text ~ 
> similar_escape('[A-Z]|[0-9]|.'::text, NULL::text))

> The value in the record cited doesn't violate the constraint,

Actually, yes it does.  SIMILAR TO (specifically similar_escape()) was
broken for patterns involving | ... but now it's fixed.  The previous
code failed to enforce that the pattern be a match to the entire data
string, but that is what is required by my reading of the SQL99 spec.
So your pattern really says that the data value has to be a *single*
letter, digit, or dot.  See

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Jim C. NasbyDate: 2006-05-26 21:44:29
Subject: Re: "blah" is not a domain error
Previous:From: William GrayDate: 2006-05-26 19:16:51
Subject: Re: BUG #2457: Make fails at copydir.c / copydir.o

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group