Re: open transaction? - Mailing list pgsql-general

From Pavel Stehule
Subject Re: open transaction?
Date
Msg-id 162867790812290422p7eed90e1o2abc3854e303f2bd@mail.gmail.com
Whole thread Raw
In response to Re: open transaction?  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
Hello

maybe you have autocommit on

try

[pavel@localhost ~]$ psql postgres
psql (8.4devel)
Type "help" for help.

postgres=# \set
AUTOCOMMIT = 'on'
PROMPT1 = '%/%R%# '
PROMPT2 = '%/%R%# '

regards
Pavel Stehule

2008/12/29 Raymond O'Donnell <rod@iol.ie>:
> On 29/12/2008 11:53, Raymond O'Donnell wrote:
>> On 29/12/2008 11:48, blackwater dev wrote:
>>
>>> Without thinking I closed by connection before committing or rolling
>>> back my transaction.  Did postgres handle this for me?  How do I see if
>>> the transaction is still open?
>>
>> I'm reasonably sure that the transaction will get rolled back if the
>> connection dies.
>
> Just tried it, and that seems to be the case:
>
> postgres=# create database test;
> CREATE DATABASE
> postgres=# \c test
> You are now connected to database "test".
> test=# create table t(f1 integer);
> CREATE TABLE
> test=# begin;
> BEGIN
> test=# insert into t values(1);
> INSERT 0 1
> test=# insert into t values(2);
> INSERT 0 1
> test=# \q
> rod@teladesign:~$ psql -U postgres test
> Password for user postgres:
> Welcome to psql 8.3.5, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>       \h for help with SQL commands
>       \? for help with psql commands
>       \g or terminate with semicolon to execute query
>       \q to quit
>
> test=# select * from t;
>  f1
> ----
> (0 rows)
>
>
>
> Ray.
>
> ------------------------------------------------------------------
> Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
> rod@iol.ie
> Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
> ------------------------------------------------------------------
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: encoding of PostgreSQL messages
Next
From: Terry Lee Tucker
Date:
Subject: Re: open transaction?