Re: [GENERAL] sql transaction

2009-03-18 Thread Gurjeet Singh
On Wed, Mar 18, 2009 at 7:11 PM, Andreas Kretschmer < akretsch...@spamfence.net> wrote: > Jasid ZA wrote: > > > Hi, > > > > Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql > > function(user defined) which is written in PL/Perl? > > No. A function is an autonomous transact

Re: [GENERAL] sql transaction

2009-03-18 Thread Alvaro Herrera
Tino Wildenhain wrote: > But this sounds like fun, I'll check how to add something to the > documentation :-) Of course it is fun. Why else do you think I spend time on it? -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Cust

Re: [GENERAL] sql transaction

2009-03-18 Thread Tino Wildenhain
Alvaro Herrera wrote: Andreas Kretschmer wrote: Alvaro Herrera wrote: Andreas Kretschmer wrote: Jasid ZA wrote: Hi, Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql function(user defined) which is written in PL/Perl? No. A function is an autonomous transaction. Y

Re: [GENERAL] sql transaction

2009-03-18 Thread Alvaro Herrera
Andreas Kretschmer wrote: > Alvaro Herrera wrote: > > > Andreas Kretschmer wrote: > > > Jasid ZA wrote: > > > > > > > Hi, > > > > > > > > Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql > > > > function(user defined) which is written in PL/Perl? > > > > > > No. A func

Re: [GENERAL] sql transaction

2009-03-18 Thread Andreas Kretschmer
Alvaro Herrera wrote: > Andreas Kretschmer wrote: > > Jasid ZA wrote: > > > > > Hi, > > > > > > Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql > > > function(user defined) which is written in PL/Perl? > > > > No. A function is an autonomous transaction. You can use s

Re: [GENERAL] sql transaction

2009-03-18 Thread Alvaro Herrera
Andreas Kretschmer wrote: > Jasid ZA wrote: > > > Hi, > > > > Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql > > function(user defined) which is written in PL/Perl? > > No. A function is an autonomous transaction. You can use savepoints. This question comes up very of

Re: [GENERAL] sql transaction

2009-03-18 Thread Andreas Kretschmer
Jasid ZA wrote: > Hi, > > Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql > function(user defined) which is written in PL/Perl? No. A function is an autonomous transaction. You can use savepoints. Andreas -- Really, I'm not out to destroy Microsoft. That will just be

[GENERAL] sql transaction

2009-03-18 Thread Jasid ZA
Hi, Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql function(user defined) which is written in PL/Perl? Thanks in advance -- With warm regards Jasid Z. A +91 9946109809

Re: [GENERAL] SQL Transaction related

2007-05-09 Thread A. Kretschmer
am Thu, dem 10.05.2007, um 2:24:40 -0400 mailte Harpreet Dhaliwal folgendes: > Hi, > > I have a transaction like following: > > BEGIN > > INSERT INTO tbl_xyz VALUES (val1, val2); > > SELECT INTO wid MAX(val1) FROM tbl_xyz; > > END; > > My question is in the SELECT INTO statement

Re: [GENERAL] SQL Transaction related

2007-05-09 Thread Uwe C. Schroeder
Yes it will. Everything INSIDE ONE transaction is visible to that exact transaction. So in your scenario the val1 from the select will see what was inserted - just any other transaction won't unless the current one is committed. Uwe On Wednesday 09 May 2007, Harpreet Dhaliwal wrote: > Hi, >

[GENERAL] SQL Transaction related

2007-05-09 Thread Harpreet Dhaliwal
Hi, I have a transaction like following: BEGIN INSERT INTO tbl_xyz VALUES (val1, val2); SELECT INTO wid MAX(val1) FROM tbl_xyz; END; My question is in the SELECT INTO statement, will I get the value of val1 from the INSERT INTO in the same transaction even though the transaction has n