Unix Technical Forum

Trigger transactions

This is a discussion on Trigger transactions within the Pgsql General forums, part of the PostgreSQL category; --> if a function includes this SQL: Update Table1 Set field_1 = 'ab'; Insert Table2(field_2) VALUES('cd'); and I create an ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 12:22 AM
Postgres User
 
Posts: n/a
Default Trigger transactions

if a function includes this SQL:

Update Table1 Set field_1 = 'ab';
Insert Table2(field_2) VALUES('cd');


and I create an update trigger on Table1:

Create Trigger Table1_Update AFTER Update
On Table1 FOR EACH ROW:

Select * From Table2


will the Select statement in the trigger see the row that I inserted
in the main function?
if not, is there another way to write these statements to that it does?

thanks

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 12:22 AM
Postgres User
 
Posts: n/a
Default Re: Trigger transactions

Question answered- needed to move Insert statement before Update in
main function.

On Fri, Mar 21, 2008 at 6:42 PM, Postgres User
<postgres.developer@gmail.com> wrote:
> if a function includes this SQL:
>
> Update Table1 Set field_1 = 'ab';
> Insert Table2(field_2) VALUES('cd');
>
>
> and I create an update trigger on Table1:
>
> Create Trigger Table1_Update AFTER Update
> On Table1 FOR EACH ROW:
>
> Select * From Table2
>
>
> will the Select statement in the trigger see the row that I inserted
> in the main function?
> if not, is there another way to write these statements to that it does?
>
> thanks
>


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:39 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com