BUG #4629: PL/pgSQL issue

Поиск
Список
Период
Сортировка
От Martin Blazek
Тема BUG #4629: PL/pgSQL issue
Дата
Msg-id 200901261739.n0QHduUT048614@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4629: PL/pgSQL issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
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.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Per database connection limit buglet
Следующее
От: Jorge Flores
Дата:
Сообщение: Re: BUG #2958: ERROR: 53200: out of memory