Skip site navigation (1) Skip section navigation (2)

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

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: PGBugs List <pgsql-bugs(at)postgresql(dot)org>
Subject: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)
Date: 2004-11-25 01:42:36
Message-ID: 48C2864A-3E83-11D9-841B-000A95C705DC@chittenden.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
> [snip]  Err... wait, this is a classic case of send first then 
> finishing to pondering the gripe.

And sending a reply to ones self without actually testing my suggestion.

>> db=# CREATE FUNCTION schma.tbl_inval() RETURNS TRIGGER AS 'BEGIN
>>         EXECUTE public.mc_init();
>>         EXECUTE public.mc_delete(''mc_key'');
>>         RETURN NULL;
>> END;' LANGUAGE 'plpgsql';
>> db=# CREATE TRIGGER tbl_inval_trg AFTER INSERT OR UPDATE OR DELETE ON 
>> schma.tbl FOR EACH STATEMENT EXECUTE PROCEDURE schma.tbl_inval();

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 TABLE t5 (i int);
Time: 35.294 ms
test=# CREATE FUNCTION t5_func() RETURNS TRIGGER AS 'BEGIN EXECUTE 
TRUE; RETURN NULL; END;' LANGUAGE 'plpgsql';
Time: 101.701 ms
test=# CREATE TRIGGER t5_func_trg AFTER INSERT ON t5 FOR EACH STATEMENT 
EXECUTE PROCEDURE t5_func();
Time: 62.345 ms
test=# INSERT INTO t5 VALUES (1);
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
         ^
Doh!  Can someone with plpgsql foo look into this?  -sc

-- 
Sean Chittenden


In response to

Responses

pgsql-hackers by date

Next:From: Francisco Figueiredo Jr.Date: 2004-11-25 02:15:41
Subject: Re: How to make @id or $id as parameter name in plpgsql,
Previous:From: Bruce MomjianDate: 2004-11-25 01:25:58
Subject: Re: -V, --version -- deprecated?

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-11-25 03:24:26
Subject: Re: plpgsql lacks generic identifier for record in triggers...
Previous:From: Sean ChittendenDate: 2004-11-25 01:23:06
Subject: Re: plpgsql lacks generic identifier for record in triggers...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group