can you tell me how to use rollback work in 'pgsql' function? and give me a exsample?

From: Nee(dot)mem(倪明) <neemem(at)atlas-china(dot)com>
To: "pgsql-general" <pgsql-general(at)postgresql(dot)org>, "systemguards" <systemguards(at)gmail(dot)com>
Subject: can you tell me how to use rollback work in 'pgsql' function? and give me a exsample?
Date: 2005-07-13 05:55:39
Message-ID: ATLAS-MAILOc7wo95EF000001bc@atlas-mail.atlas-mail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


i see you wrote on this page
http://archives.postgresql.org/pgsql-general/2005-07/msg00319.php

test exsample:
create or replace function test()
returns void as
'
begin
delete from regiondata;
rollback;
end;
'language 'plpgsql';
but exception a error: CONTEXT: PL/pgSQL function "test" line 3 at SQL statement
Use others' words :
>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 only for grouping; they do not start or end a transaction
and can you tell me how to use rollback work in 'pgsql' function? and give me a exsample?

        

        alan.nee
        neemem(at)gmail(dot)com
          2005-07-13

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Rittinger 2005-07-13 06:15:53 Re: Windows version of PostgreSQL 8?
Previous Message Joshua D. Drake 2005-07-13 05:35:39 Re: Transaction Handling in pl/pgsql?