From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Goran Buzic <goran.buzic@hep.hr>
Cc: pgsql-sql@postgresql.org
Subject: Re: POSIX-style regular expressions
Date: Tue, 10 Sep 2002 11:15:15 -0400
Message-ID: <19730.1031670915@sss.pgh.pa.us> (raw)
In-Reply-To: <20020910080224.L24403-100000@megazone23.bigpanda.com>
References: <20020910080224.L24403-100000@megazone23.bigpanda.com>
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> On Tue, 10 Sep 2002, Goran Buzic wrote:
>> id1 char(6) NOT NULL CHECK(id1 ~* '^([0-9]{1,2}\.){2}$'),
> Bad column type choice. char(6) is space padded, so 1.2. looks like
> "1.2. ". For me, 12.12. works, but any shorter one fails. Unless
> you need space padding elsewhere, you may just want to use varchar(6);
Also, the backslash has to be doubled to get through the string literal
parser, so what you really want is
id1 varchar(6) NOT NULL CHECK(id1 ~* '^([0-9]{1,2}\\.){2}$'),
else it will accept values you don't want...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, sszabo@megazone23.bigpanda.com, goran.buzic@hep.hr
Subject: Re: POSIX-style regular expressions
In-Reply-To: <19730.1031670915@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox