[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pgsql-bugs
Subject:    [BUGS] BUG #4629: PL/pgSQL issue
From:       "Martin Blazek" <mblazek () 8bc ! com>
Date:       2009-01-26 17:39:56
Message-ID: 200901261739.n0QHduUT048614 () wwwmaster ! postgresql ! org
[Download RAW message or body]


The following bug has been logged online:

Bug reference:      4629
Logged by:          Martin Blazek
Email address:      mblazek@8bc.com
PostgreSQL version: 8.3.5
Operating system:   Windows XP
Description:        PL/pgSQL issue
Details: 

I try to create the following rule.  It doesn't make much sense, but the
syntax is ok and if the table "test" exists, it is created.
 
CREATE RULE "rule" AS ON INSERT TO "test" DO INSTEAD INSERT INTO "test"
VALUES (1);
 
The next step is creating a function that contains only the following
command:
 
CREATE FUNCTION test() RETURNS integer AS $$
BEGIN
CREATE RULE "rule" AS ON INSERT TO "test" DO INSTEAD INSERT INTO "test"
VALUES (1);
END;$$ LANGUAGE plpgsql;
 
Wow!  Here's the result (already on function create, not during runtime):
 
ERROR:  syntax error at ""test""
DETAIL:  Expected record variable, row variable, or list of scalar variables
following INTO.
KONTEXT:  compile of PL/pgSQL function "test" near line 2
 
It appears that only insert rules have this issue - update and delete work
as expected.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic