X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id EE1AB9FB232 for ; Sat, 8 Jul 2006 12:20:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 95357-02 for ; Sat, 8 Jul 2006 12:20:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31810.mail.mud.yahoo.com (web31810.mail.mud.yahoo.com [68.142.207.73]) by postgresql.org (Postfix) with SMTP id CEFB39FB22D for ; Sat, 8 Jul 2006 12:20:22 -0300 (ADT) Received: (qmail 73356 invoked by uid 60001); 8 Jul 2006 15:20:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=nw7kG1GjN/k3MkbPIA3qtjbVLFzoo6cUoXUCWOx8Z3LxeL3BAJkUW+G9e75vy4nytJVRWjdSTyhzRhFn1TwUb8aTl+/AKukpRdGyQzRm3p6WHOXhSQtLAknCTTHFtgzkqlaFsa+n8k+ZULpDkEEE5qWXXas2cfzCyKmwWxYI6aM= ; Message-ID: <20060708152022.73354.qmail@web31810.mail.mud.yahoo.com> Received: from [24.54.196.198] by web31810.mail.mud.yahoo.com via HTTP; Sat, 08 Jul 2006 08:20:22 PDT Date: Sat, 8 Jul 2006 08:20:22 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Celko's Puzzle Number 5 To: Michael Fuhr Cc: SQL Postgresql List In-Reply-To: <20060708115403.GA13518@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/134 X-Sequence-Number: 25708 > http://www.postgresql.org/docs/8.1/interactive/functions-matching.html > > Any of these CHECK expressions should work: > > CHECK (alpha_only SIMILAR TO '[A-Za-z]+') > CHECK (alpha_only ~ '^[A-Za-z]+$') > CHECK (alpha_only ~* '^[a-z]+$') > > Unfortunately, even though SIMILAR TO has been standard SQL for > several years, not all databases implement it. Many databases > do support regular expressions but generally via a non-standard > syntax (as PostgreSQL does with its ~, ~*, !*, and !~* operators). Thanks for the link! Regards, Richard Broersma Jr.