Re: define transaction within pg/psql. Necessary?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Antonio Goméz Soto <antonio(dot)gomez(dot)soto(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: define transaction within pg/psql. Necessary?
Date: 2010-02-18 10:07:26
Message-ID: 4B7D115E.8010603@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 18/02/10 10:02, Antonio Goméz Soto wrote:
>
> if I define a pg/pgsql function, and I call that outside a transaction,
> does it create one for itself? Or should I add BEGIN and COMMIT
> statements within
> the function?

You can't call a function outside a transaction. Every statement in
PostgreSQL is inside a transaction, either one you define yourself, or
an implicit one that just lasts for the duration of one statement.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dipti shah 2010-02-18 10:23:54 Re: Define permissions at database level
Previous Message Grzegorz Jaśkiewicz 2010-02-18 10:06:46 Re: define transaction within pg/psql. Necessary?