From: | Wolfgang Walter <wolfgang(dot)walter(at)studentenwerk(dot)mhn(dot)de> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | pgtcl combined with view with certain insert/update-rules => crash |
Date: | 2003-01-24 14:03:07 |
Message-ID: | 3E31479B.6CD06B69@studentenwerk.mhn.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hi,
since 7.3 we observe repeatable crashes of the backend under certain
conditions.
If pgtcl-function executes an INSERT-command via spi-exec on a view with
an INSERT-rule which actually does not do an insert but a SELECT instead
the backend crashes when the rule-execution finished.
This does not happen if you do the same INSERT via psql-tool or from
within a pgsql-function via EXECUTE.
The same is true for UPDATE-command/rule.
Executing an INSERT as last statement of a rules fixes the problem.
postgresql 7.2 works fine.
Example:
CREATE VIEW a AS
SELECT f FROM b;
CREATE RULE r AS ON INSERT TO a DO INSTEAD (
SELECT xyz(NEW.f);
);
xyz is any stored procedure (i.e. written in pgsql).
(though I don't think it is important that a stored procedured is called
at all via the select).
CREATE FUNCTION t () RETURNS VOID AS '
spi_exec "INSERT INTO a (f) VALUES (''5'')"
' LANGUAGE 'pltcl';
Then calling t from psql i.e. leads to a crash.
If you change the rule r to
CREATE RULE r AS ON INSERT TO a DO INSTEAD (
SELECT xyz(NEW.f);
INSERT INTO dummy (bla) VALUES ('abcdefg');
);
(and table dummy exists of course)
then t works fine.
--
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts
EDV
Leopoldstraße 15
80802 München
Tel: +49 89 38196 276
Fax: +49 89 38196 144
wolfgang(dot)walter(at)studentenwerk(dot)mhn(dot)de
http://www.studentenwerk.mhn.de/
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-01-24 16:03:48 | Re: Bug #882: Cannot manually log in to database. |
Previous Message | Giles Lean | 2003-01-24 14:02:54 | Re: Bug #882: Cannot manually log in to database. |