I was working on trigger support for PL/R and ran across this bug in my
own code related to STATEMENT level triggers. I decided to try it in PL/Tcl:

regression=# CREATE FUNCTION tcltrigfunc() RETURNS trigger AS '
regression'# return OK
regression'# ' LANGUAGE pltcl;
CREATE FUNCTION
regression=#
regression=# CREATE TRIGGER tcltrig BEFORE INSERT OR UPDATE OR DELETE ON foo
regression-# FOR EACH STATEMENT EXECUTE PROCEDURE tcltrigfunc();
CREATE TRIGGER
regression=# insert into foo values(11,'cat99',1.89);
The connection to the server was lost. Attempting reset: Failed.
connection pointer is NULL
!>

Hmm, same problem. Looks like PL/pgSQL does the right thing, but
plpython will crash also. I don't think plperl supports triggers.

I'll try to submit a patch later tonight or tomorrow morning if no one
beats me to it.

Joe

Search Discussions

  • Neil Conway at Aug 4, 2003 at 8:09 am

    Joe Conway said:
    Hmm, same problem. Looks like PL/pgSQL does the right thing, but
    plpython will crash also. I don't think plperl supports triggers.
    Right -- I only had time to implement support for statement-level
    triggers in the backend itself and in PL/PgSQL. Thanks for taking the
    time to update PL/TCL -- you're welcome to go ahead and fix PL/Python
    as well, if you're so inclined.

    -Neil
  • Elein at Aug 5, 2003 at 10:55 pm
    I thought that statement level triggers did not work yet.
    Are they supposed to work in 7.4?

    (But even if they don't work they shouldn't crash...)

    elein
    On Sun, Aug 03, 2003 at 08:04:11PM -0700, Joe Conway wrote:
    I was working on trigger support for PL/R and ran across this bug in my
    own code related to STATEMENT level triggers. I decided to try it in PL/Tcl:

    regression=# CREATE FUNCTION tcltrigfunc() RETURNS trigger AS '
    regression'# return OK
    regression'# ' LANGUAGE pltcl;
    CREATE FUNCTION
    regression=#
    regression=# CREATE TRIGGER tcltrig BEFORE INSERT OR UPDATE OR DELETE ON foo
    regression-# FOR EACH STATEMENT EXECUTE PROCEDURE tcltrigfunc();
    CREATE TRIGGER
    regression=# insert into foo values(11,'cat99',1.89);
    The connection to the server was lost. Attempting reset: Failed.
    connection pointer is NULL
    !>

    Hmm, same problem. Looks like PL/pgSQL does the right thing, but
    plpython will crash also. I don't think plperl supports triggers.

    I'll try to submit a patch later tonight or tomorrow morning if no one
    beats me to it.

    Joe



    ---------------------------(end of broadcast)---------------------------
    TIP 4: Don't 'kill -9' the postmaster
  • Joe Conway at Aug 6, 2003 at 1:31 am

    elein wrote:
    I thought that statement level triggers did not work yet.
    Are they supposed to work in 7.4?

    (But even if they don't work they shouldn't crash...)
    Yeah, they work - not as everyone would like, but they work. All fixed
    now anyway.

    Joe

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedAug 4, '03 at 3:07a
activeAug 6, '03 at 1:31a
posts4
users3
websitepostgresql.org...
irc#postgresql

3 users in discussion

Joe Conway: 2 posts Neil Conway: 1 post Elein: 1 post

People

Translate

site design / logo © 2022 Grokbase