Re: Behaviour of sql language function - Mailing list pgsql-docs

From Kevin Grittner
Subject Re: Behaviour of sql language function
Date
Msg-id 4F996F80020000250004741C@gw.wicourts.gov
Whole thread Raw
In response to Behaviour of sql language function  (Marcelo Sena <marceloslacerda@gmail.com>)
Responses Re: Behaviour of sql language function  (Marcelo Sena <marceloslacerda@gmail.com>)
List pgsql-docs
Marcelo Sena <marceloslacerda@gmail.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

pgsql-docs by date:

Previous
From: Marcelo Sena
Date:
Subject: Behaviour of sql language function
Next
From: Tom Lane
Date:
Subject: Re: Date/Time Types : internals