pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin Crundall <pgsql@ac6rm.net>
To: tgl@sss.pgh.pa.us
Cc: pgsql-sql@postgresql.org
Subject: Re: TRIGGERed INSERTS
Date: Fri, 18 Oct 2002 09:59:10 -0700 (PDT)
Message-ID: <63503.24.52.245.104.1034960350.squirrel@webmail.ac6rm.net> (raw)
In-Reply-To: <17482.1034950973@sss.pgh.pa.us>
References: <63387.24.52.245.104.1034949598.squirrel@webmail.ac6rm.net>
	<17482.1034950973@sss.pgh.pa.us>

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@ac6rm.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






view thread (4+ messages)

Message-ID: <63503.24.52.245.104.1034960350.squirrel@webmail.ac6rm.net>
Permalink:  ../63503.24.52.245.104.1034960350.squirrel@webmail.ac6rm.net/
Also on:    postgresql.org/message-id/63503.24.52.245.104.1034960350.squirrel@webmail.ac6rm.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgsql@ac6rm.net, tgl@sss.pgh.pa.us
  Subject: Re: TRIGGERed INSERTS
  In-Reply-To: <63503.24.52.245.104.1034960350.squirrel@webmail.ac6rm.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox