Re: COMMIT in PostgreSQL

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: stefan(at)extum(dot)com
Cc: Steve Brett <SBrett(at)e-mis(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: COMMIT in PostgreSQL
Date: 2002-07-19 11:37:35
Message-ID: 20020719213735.A13280@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jul 20, 2002 at 03:03:02PM +0300, stefan(at)extum(dot)com wrote:
>
>
> thanks a lot all for comments. So in PostgreSQL each query is a
> transaction ?

If you want them that way. If you want to combine them into one transaction,
you use BEGIN.

> In PostgreSQL the changes are visible as long as you run the query.

If they're not in a transaction

> On Fri, 19 Jul 2002, Steve Brett wrote:
>
> > AFAIAA each query sent to the backend is a transaction and is treated as
> > such unless you explicitly send a BEGIN.
> >
> > If you send a BEGIN then you can send multiple INSERTS etc and then do a
> > manual COMMIT.
> >
> > I've never used Oracle (as the comapny I work for can't afford it !) so I
> > wouldn't be able to supply you with a comparison.
> >
> > Steve
> >
> > > -----Original Message-----
> > > From: stefan(at)extum(dot)com [mailto:stefan(at)extum(dot)com]
> > > Sent: 20 July 2002 12:51
> > > To: pgsql-general(at)postgresql(dot)org
> > > Subject: [GENERAL] COMMIT in PostgreSQL
> > >
> > >
> > >
> > > Hey,
> > >
> > > I was running a script which does some INSERTS and UPDATE
> > > some table. I
> > > found that there is no need for COMMIT; After each statement
> > > the TABLE is
> > > immediately commited. Other session via psql can sees ASAP
> > > the changes to
> > > the table. So it seems a bit different than Oracle's COMMIT .
> > > Can somebody
> > > explain me why this is so in PostgreSQL ?
> > >
> > > Are the modifications done without commit statement ?
> > >
> > > PostgreSQL looks really interesting and seems to be good SQL
> > > compliant.
> > > stefan
> > >
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 6: Have you searched our list archives?
> > >
> > > http://archives.postgresql.org
> > >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-07-19 11:47:09 Re: Regular expression validation
Previous Message Stephane Bortzmeyer 2002-07-19 11:30:07 Re: COMMIT in PostgreSQL