From: | "Martin Crundall" <pgsql(at)ac6rm(dot)net> |
---|---|
To: | <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: TRIGGERed INSERTS |
Date: | 2002-10-18 16:59:10 |
Message-ID: | 63503.24.52.245.104.1034960350.squirrel@webmail.ac6rm.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Thanks Tom. The work-around was to create the "script" in SQL -- using
SELECT INTO statements to capture the key values -- instead of creating
the "script" as a stored procedure.
Seems like a "transaction" issue. Having transactions occur at the SELECT
level is very intuitive and a really nice, "protect-us-from-ourselves"
feature that I'm not sure I'd want to mess with. Having the ability to
execute a stored procedure outside the scope of a SELECT would ultimately
resolve this. A topic for another day ... unless I missed something in an
update somewhere.
Anyway, thanks again.
> "Martin Crundall" <pgsql(at)ac6rm(dot)net> writes:
>> Some of the data tables have "AFTER INSERT" TRIGGERs on them that,
>> in
>> turn, insert some subordinate items into parallel data tables and the
>> central pointer/ordering table.
>
> It looks to me like AFTER triggers are fired upon return to the main
> loop in postgres.c, thus only at the end of a querystring sent by the
> client. This is perhaps wrong, but I'm not sure that allowing them to
> fire during plpgsql functions would be a good thing either.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
From | Date | Subject | |
---|---|---|---|
Next Message | Ian Harding | 2002-10-18 17:10:15 | Re: Is there anyway to do this? |
Previous Message | Wei Weng | 2002-10-18 16:45:56 | Is there anyway to do this? |