SIMILAR TO

From: Rommel the iCeMAn <icecrew(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: SIMILAR TO
Date: 2010-10-16 14:26:46
Message-ID: AANLkTin0sFTh=A6nPUj8dfumGRbALJT=cJrBew6mxxfK@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi guys,

I use the following code to detect alphanumeric strings:

IF _my_variable SIMILAR TO '^[a-zA-Z0-9]+$' THEN
        // do stuff here
END IF;

In pg8.4 this worked perfectly. I upgraded to pg9.0 and it no longer
works. From the release notes it appears that the behavior of SIMILAR
TO has changed in pg9.0. My question is, how do I modify my code so
that it works in 9.0?

Thanks in advance.
Rommel.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2010-10-16 14:30:14 Re: SIMILAR TO
Previous Message Thomas Kellerer 2010-10-16 07:23:03 Re: How to collect text-fields from multiple rows ?