I have a database in which I used domains with check constraints
to keep all the constraints nice and uniform for like columns across
tables. My users access and update data primarily through function
calls that have parameters that of DOMAIN types.
These constraints work when I call the functions via psql or
from a PHP client. But, my pqlib users seem to be able to get bad
data in. I have not done any real testing yet to track this down,
but have looks through the archives and have not been able to spot
anything. Anybody else seen something like this? Am I missing
I have noticed that I can cast the bad data to the domain type,
but not to a varchar and then the domain type.
Select passcode::D_PASSCODE from
employee_passcode; -- will work
Select passcode::varchar::D_PASSCODE from employee_passcode; --
properly complains --> ERROR: value for domain d_passcode violates
check constraint "d_passcode_check"
It looks like the data is not checked when passed to the
function and from their on out since it is already the correct type
it is not checked again. Has anyone else seen something like this?
I am using 8.0.1. On the pqlib side we are calling PQexecParams
and using NULL for param types for the function calls in question.
pgsql-hackers by date
|Next:||From: Bruce Momjian||Date: 2005-07-06 14:26:58|
|Subject: Re: timezone changes break windows and cygwin|
|Previous:||From: Marko Kreen||Date: 2005-07-06 10:42:49|
|Subject: Re: pgcrypto 3des failure, OpenSSL 0.9.8, Solaris 9/sparc|
pgsql-interfaces by date
|Next:||From: Tom Lane||Date: 2005-07-06 14:35:37|
|Subject: Re: By Passed Domain Constraints |
|Previous:||From: jtv||Date: 2005-07-06 07:39:12|
|Subject: Re: libpq and connection failures|