Re: regexp err msg question - Mailing list pgsql-general

From Tom Lane
Subject Re: regexp err msg question
Date
Msg-id 22672.1291736721@sss.pgh.pa.us
Whole thread Raw
In response to regexp err msg question  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Responses Re: regexp err msg question  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List pgsql-general
"Gauthier, Dave" <dave.gauthier@intel.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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: if-clause to an exiting statement
Next
From: Jon Nelson
Date:
Subject: Re: dotted quad netmask conversion