PostgreSQL cannot begin/end transactions in PL/pgSQL

前端 未结 2 601
悲哀的现实
悲哀的现实 2020-12-16 09:28

I am seeking clarification of how to ensure an atomic transaction in a plpgsql function, and where the isolation level is set for this particular change to the database.

2条回答
  •  死守一世寂寞
    2020-12-16 10:17

    START TRANSACTION;
    select foo() ;
    COMMIT;
    

    "Unfortunately Postgres has no stored procedures, so you always need to manage the transaction in the calling code" – a_horse_with_no_name

    Transaction in an exception block - how?

提交回复
热议问题