Lists: | pgsql-bugs |
---|
From: | "Boris Sukholitko" <bobatonhu(at)yahoo(dot)co(dot)uk> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #1759: domain check constraint ignored in prepared statement |
Date: | 2005-07-07 14:08:47 |
Message-ID: | 20050707140847.471C1F0CBE@svr2.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 1759
Logged by: Boris Sukholitko
Email address: bobatonhu(at)yahoo(dot)co(dot)uk
PostgreSQL version: 7.4.8
Operating system: Linux
Description: domain check constraint ignored in prepared statement
Details:
Hi,
It seems that the domain check constraint does not trigger
an error when using prepared statement in perl's DBD::Pg 1.42.
It seemed to work in earlier versions of DBD::Pg module.
The following code snippet manifests the problem:
#!/usr/bin/perl -w
use strict;
use DBI;
use DBD::Pg;
my $dbh = DBI->connect("dbi:Pg:dbname=testdb");
$dbh->do(<<ENDS);
create domain display_text_d text
constraint display_text_d_non_empty_chk check (VALUE ~
'[a-zA-z0-9]');
create table domain_test (d display_text_d not null);
ENDS
my $s = $dbh->prepare("insert into domain_test (d) values (?)");
# This execute will succeed leaving invalid value
# in the database
$s->execute(' ');
# This statement fails due to the check constraint
# as expected
$dbh->do("insert into domain_test (d) values (?)", undef, ' ');
Thanks,
Boris.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Boris Sukholitko" <bobatonhu(at)yahoo(dot)co(dot)uk> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #1759: domain check constraint ignored in prepared statement |
Date: | 2005-07-07 15:16:13 |
Message-ID: | 8334.1120749373@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
"Boris Sukholitko" <bobatonhu(at)yahoo(dot)co(dot)uk> writes:
> It seems that the domain check constraint does not trigger
> an error when using prepared statement in perl's DBD::Pg 1.42.
I think this is the same issue discussed in this thread:
http://archives.postgresql.org/pgsql-interfaces/2005-07/msg00006.php
regards, tom lane