BUG #4629: PL/pgSQL issue

From: "Martin Blazek" <mblazek(at)8bc(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4629: PL/pgSQL issue
Date: 2009-01-26 17:39:56
Message-ID: 200901261739.n0QHduUT048614@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4629
Logged by: Martin Blazek
Email address: mblazek(at)8bc(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Nick Withers 2009-01-27 05:37:51 BUG #4630: Null-pointer dereference on FreeBSD / PowerPC in PageIsPrunable ()
Previous Message Tom Lane 2009-01-26 15:40:15 Re: Per database connection limit buglet