Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 33DEB476092 for ; Tue, 10 Sep 2002 11:04:14 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id B8672475CEE for ; Tue, 10 Sep 2002 11:04:13 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id ACF13D5FA; Tue, 10 Sep 2002 08:04:14 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id A29EE5C03; Tue, 10 Sep 2002 08:04:14 -0700 (PDT) Date: Tue, 10 Sep 2002 08:04:14 -0700 (PDT) From: Stephan Szabo To: Goran Buzic Cc: Subject: Re: POSIX-style regular expressions In-Reply-To: Message-ID: <20020910080224.L24403-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/70 X-Sequence-Number: 9347 On Tue, 10 Sep 2002, Goran Buzic wrote: > Hi > > Can anybody help me with POSIX-style regular expression used to check rules > that new data must satisfy for an insert or update operetion. > > Table was created as follows. > > CREATE TABLE table_name1 ( > 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);