Re: [GENERAL] Transaction Handling in pl/pgsql?

2005-07-13 Thread Neil Conway
Joshua D. Drake wrote: If you are using savepoints you can rollback to a specific point of a parent transaction. Although you can't use savepoints (explicitly) in functions. PL/PgSQL exceptions (which are actually implemented internally via savepoints) can be used to achieve a similar effect.

Re: [GENERAL] Transaction Handling in pl/pgsql?

2005-07-12 Thread Joshua D. Drake
>>your_function adds some rows but the last one gives an error, because >>all statements that are out of a transaction block are in its own >>transaction the select calling your_function is inside a >>transaction... so, the answer is yes... the statements inside the >>function will be rolled back

[GENERAL] Transaction Handling in pl/pgsql?

2005-07-12 Thread Nee.mem(倪明)
pgsql-general,    On 7/12/05, Craig Bryden wrote: > Hi > > I am trying to get a better understanding of how transactions work in > pl/pgsql functions. I found the following text in the help: > "It is important not to confuse the use of BEGIN/END for grouping statements > in PL/pgSQL wi

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
Thanks a stack. That has answered by question. Craig - Original Message - From: "Douglas McNaught" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "pgsql" Sent: Tuesday, July 12, 2005 8:46 PM Subject: Re: [GENERAL] Transact

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Douglas McNaught
"Craig Bryden" <[EMAIL PROTECTED]> writes: > OK. I have read that. The part that sticks out is "A block containing an > EXCEPTION clause is significantly more expensive to enter and exit than a > block without one. Therefore, don't use EXCEPTION without need. ". > Performance is paramount to me. >

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Christopher Browne
> I am trying to get a better understanding of how transactions work in > pl/pgsql functions. I found the following text in the help: > "It is important not to confuse the use of BEGIN/END for grouping statements > in PL/pgSQL with the database commands for transaction control. PL/pgSQL's > BEGIN/E

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
2005 7:37 PM Subject: Re: [GENERAL] Transaction Handling in pl/pgsql On 7/12/05, Craig Bryden <[EMAIL PROTECTED]> wrote: > Hi > > I am trying to get a better understanding of how transactions work in > pl/pgsql functions. I found the following text in the help: > "It is i

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
se will all the statements still be rolled back if an error occurs? Thanks Craig - Original Message - From: "Douglas McNaught" <[EMAIL PROTECTED]> To: "Craig Bryden" <[EMAIL PROTECTED]> Cc: "pgsql" Sent: Tuesday, July 12, 2005 7:43 PM Subject: Re: [GE

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Douglas McNaught
"Craig Bryden" <[EMAIL PROTECTED]> writes: > I am trying to get a better understanding of how transactions work in > pl/pgsql functions. I found the following text in the help: > "It is important not to confuse the use of BEGIN/END for grouping statements > in PL/pgSQL with the database commands f

Re: [GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Jaime Casanova
On 7/12/05, Craig Bryden <[EMAIL PROTECTED]> wrote: > Hi > > I am trying to get a better understanding of how transactions work in > pl/pgsql functions. I found the following text in the help: > "It is important not to confuse the use of BEGIN/END for grouping statements > in PL/pgSQL with the dat

[GENERAL] Transaction Handling in pl/pgsql

2005-07-12 Thread Craig Bryden
Hi I am trying to get a better understanding of how transactions work in pl/pgsql functions. I found the following text in the help: "It is important not to confuse the use of BEGIN/END for grouping statements in PL/pgSQL with the database commands for transaction control. PL/pgSQL's BEGIN/END are