Re: regexp err msg question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: regexp err msg question
Date: 2010-12-07 15:45:21
Message-ID: 22672.1291736721@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> mydb=# select distinct fivr from alphaview where name ~ ''^foo'';
> ERROR: type "foo" does not exist

> (note: those are two single quotes before the ^ and after foo, NOT double quotes)

You realize of course that you've got too many quotes there.

> Could someone explain the error message?

I think it's parsing that as

name ~ '' ^ foo ''

That is, empty string literal, ^ operator, typename preceding string
literal, empty string literal. The "typename 'string'" syntax wasn't
one of the SQL committee's better ideas :-(

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kobi Biton 2010-12-07 16:04:39 Re: if-clause to an exiting statement
Previous Message Tom Lane 2010-12-07 15:37:40 Re: SELECT is immediate but the UPDATE takes forever