On Mon, Sep 15, 2008 at 10:55 AM, c k <shreeseva.learning@xxxxxxxxx> wrote: > Dear PG members, > I want to know that does begin and end in plpgsql are related to begin > transactions and commit? if yes/no how? No. a plpgsql function is a transaction in its entirety. If called within a transaction it inherits the parent transaction. >If I start to execute a function of > multiple statements does PG commits each transaction within a function, or > whole function as a transaction. Whole thing, all or nothing. > Also if first statement makes inserts/updates a row, does it automatically > available to that particular function execution only or to any other > instances of same function? To that function only. Until commit no one else should see the change. > Please give the details. > In my system, function are extensively used and cab called by different > clients as ODBC, JDBC and others. How called isn't all that critical, unless you've set some kind of autocommit flag or something.