Re: regexp err msg question

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

Yes, someone is using too many quotes, I think in a script because the log file
gets bursts of these messages. I need to foind out who's doing this. I know
pg_stat_activity is the key in that endevour, but these are remote db queries,
so I have to figure out how to deal with that indirection.

I was curious where the reference to "type" came from in the error message.

Thanks Tom.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Tuesday, December 07, 2010 10:45 AM
To: Gauthier, Dave
Cc: pgsql-general List
Subject: Re: [GENERAL] regexp err msg question

"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

Browse pgsql-general by date

  From Date Subject
Next Message Gabi Julien 2010-12-07 16:31:55 Postgresql 9.1 pg_last_xact_replay_timestamp limitations
Previous Message Kobi Biton 2010-12-07 16:04:39 Re: if-clause to an exiting statement