Re: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)
Date
Msg-id 24145.1101353795@sss.pgh.pa.us
Whole thread Raw
In response to Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)  (Sean Chittenden <sean@chittenden.org>)
Responses Re: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)
List pgsql-bugs
Sean Chittenden <sean@chittenden.org> writes:
> Which, doesn't work as expected as it seems as though there's something
> left behind on the stack that shouldn't be.  Here's the case to
> reproduce (doesn't involve pgmemcache):

> test=# CREATE FUNCTION t5_func() RETURNS TRIGGER AS 'BEGIN EXECUTE
> TRUE; RETURN NULL; END;' LANGUAGE 'plpgsql';

What are you expecting "execute true" to do?  The argument of EXECUTE
is a string, not a boolean, and it's supposed to be a string that looks
like a SQL command.  The result

> ERROR:  syntax error at or near "t" at character 1
> QUERY:  t
> CONTEXT:  PL/pgSQL function "t5_func" line 1 at execute statement
> LINE 1: t
>          ^

is pretty much what I'd expect considering that plpgsql will do whatever
it takes to coerce the expression result to text.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Sean Chittenden
Date:
Subject: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)
Next
From: Kent Tong
Date:
Subject: Re: equal operator fails on two identical strings if initdb