Re: Behaviour of sql language function

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Marcelo Sena" <marceloslacerda(at)gmail(dot)com>, <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Behaviour of sql language function
Date: 2012-04-26 20:53:36
Message-ID: 4F996F80020000250004741C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Marcelo Sena <marceloslacerda(at)gmail(dot)com> wrote:

> So, is it documented somewhere?

http://www.postgresql.org/docs/current/static/tutorial-transactions.html

| PostgreSQL actually treats every SQL statement as being executed
| within a transaction. If you do not issue a BEGIN command, then
| each individual statement has an implicit BEGIN and (if
| successful) COMMIT wrapped around it.

Combine this with the fact that a function can only run in the
context of a command, like:

SELECT func_name();

You have your guarantee -- as long as you understand the possible
action of subtransactions (like savepoints).

-Kevin

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2012-04-26 21:15:19 Re: Date/Time Types : internals
Previous Message Marcelo Sena 2012-04-26 19:45:40 Behaviour of sql language function