Re: My error or parser bug? re stored function [SEC=UNCLASSIFIED] - Mailing list pgsql-novice

From Tom Lane
Subject Re: My error or parser bug? re stored function [SEC=UNCLASSIFIED]
Date
Msg-id 29057.1297440182@sss.pgh.pa.us
Whole thread Raw
In response to My error or parser bug? re stored function [SEC=UNCLASSIFIED]  ("Pilling, Michael" <Michael.Pilling@dsto.defence.gov.au>)
List pgsql-novice
"Pilling, Michael" <Michael.Pilling@dsto.defence.gov.au> writes:
> Hi, I'm new to postgres but not to SQL, and have not been able to this stored function to compile:

FWIW, I get completely different errors than you do when I paste these
examples into psql:

ERROR:  syntax error at or near "voice_spelling"
LINE 5:  IF EXISTS( voice_spelling( $1, $2, $3, $4  ) ) THEN
                    ^

ERROR:  syntax error at or near "voice_spelling"
LINE 5:  IF EXISTS( voice_spelling( abbreviation, context, tts_engin...
                    ^

These errors make sense to me because the argument of EXISTS() has to
be a sub-SELECT.  I'm not sure what you're expecting EXISTS to do with a
function call.

As far as the errors you actually got, it's difficult to say for sure
without any context like what PG version this is or what client-side
software you were using.  The formatting you show for the errors sure
doesn't look like psql, though.  First guess is that you were passing
the SQL code through something that thinks it knows SQL syntax but
doesn't cope well with dollar-quoted strings, or something like that.

            regards, tom lane

pgsql-novice by date:

Previous
From: Maximilian Tyrtania
Date:
Subject: Re: Make pgAdmin default "Not NULL" checkbox to ON
Next
From: matty jones
Date:
Subject: Re: table design