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

substring with this pattern works in 8.3.1; does not work in 8.3.4

From: "Chris Wood" <chris(dot)wood(at)bookitnow(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Subject: substring with this pattern works in 8.3.1; does not work in 8.3.4
Date: 2008-11-12 18:07:46
Message-ID: 84d154660811121007w764a02a7i6cf475ec7c253a2e@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
I apologize in advance for not testing  on 8.3.5,  but that would be very
difficult for me.

here is where it works in 8.3.1:
protocalte=> select version() ;
                                        version
----------------------------------------------------------------------------------------
 PostgreSQL 8.3.1 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3
(Debian 4.2.3-2)
(1 row)

protocalte=> CREATE TABLE locn (
    locn_key integer NOT NULL,
    public_phone text NOT NULL,
    CONSTRAINT public_phone_ch CHECK (((public_phone = ''::text) OR
("substring"(public_phone, '^[0-9]{10}(,[0-9]{10})*$'::text) IS NOT NULL)))
);
CREATE TABLE
protocalte=> insert into locn values(10, '1231231234') ;
INSERT 0 1

and here is where it does not work in 8.3.4:
postgresbugs=# select version() ;
                                          version
--------------------------------------------------------------------------------------------
 PostgreSQL 8.3.4 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian
4.3.2-1) 4.3.2
(1 row)

postgresbugs=# CREATE TABLE locn (
    locn_key integer NOT NULL,
    public_phone text NOT NULL,
    CONSTRAINT public_phone_ch CHECK (((public_phone = ''::text) OR
("substring"(public_phone, '^[0-9]{10}(,[0-9]{10})*$'::text) IS NOT NULL)))
);
CREATE TABLE
postgresbugs=# insert into locn values(10, '1231231234') ;
ERROR:  new row for relation "locn" violates check constraint
"public_phone_ch"

Responses

pgsql-bugs by date

Next:From: chris woodDate: 2008-11-12 18:45:27
Subject: BUG #4525: substring with this pattern works in 8.3.1; does not work in 8.3.4
Previous:From: Hiroshi SaitoDate: 2008-11-12 16:15:28
Subject: Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows

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