pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Commit not required for update statement
6+ messages / 4 participants
[nested] [flat]

* Commit not required for update statement
@ 2018-10-15 02:30  prasanna rk <prasanna2mail@gmail.com>
  0 siblings, 2 replies; 6+ messages in thread

From: prasanna rk @ 2018-10-15 02:30 UTC (permalink / raw)
  To: pgsql-admin

Hi all

We are running posters 10.4 version, wanted to know if commit statement is
not required for update.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Commit not required for update statement
@ 2018-10-15 02:44  Evan Bauer <evanbauer@mac.com>
  parent: prasanna rk <prasanna2mail@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Evan Bauer @ 2018-10-15 02:44 UTC (permalink / raw)
  To: prasanna rk <prasanna2mail@gmail.com>; +Cc: pgsql-admin

Autocommit is, by default, off for embedded SQL programs in PostgreSQL 10.  The syntax to change that is:

SET AUTOCOMMIT TO ON

Cheers,

- Evan

Evan Bauer
eb@evanbauer.com
+1 646 641 2973
Skype: evanbauer


> On Oct 14, 2018, at 22:30, prasanna rk <prasanna2mail@gmail.com> wrote:
> 
> Hi all
> 
> We are running posters 10.4 version, wanted to know if commit statement is not required for update.





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Commit not required for update statement
@ 2018-10-15 03:49  Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
  parent: prasanna rk <prasanna2mail@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Mark Kirkwood @ 2018-10-15 03:49 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi,

Definitely worth reading what the docs say about this, should clear 
things up: 
https://www.postgresql.org/docs/current/static/tutorial-transactions.html

regards

Mark


On 15/10/18 15:30, prasanna rk wrote:
> Hi all
>
> We are running posters 10.4 version, wanted to know if commit 
> statement is not required for update.





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Commit not required for update statement
@ 2018-10-15 05:06  prasanna rk <prasanna2mail@gmail.com>
  parent: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
  0 siblings, 1 reply; 6+ messages in thread

From: prasanna rk @ 2018-10-15 05:06 UTC (permalink / raw)
  To: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>; +Cc: pgsql-admin@lists.postgresql.org

Hi Mark

Thank you for sharing, as per the link

https://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 BEGINcommand, then each individual
statement has an implicit BEGIN and (if successful) COMMIT wrapped around
it. A group of statements surrounded by BEGIN and COMMIT is sometimes
called a *transaction block*."
Note

Some client libraries issue BEGINand COMMIT commands automatically, so that
you might get the effect of transaction blocks without asking. Check the
documentation for the interface you are using.
Does this mean..every statement which does not have begin will be
automatically commited.


On Mon, 15 Oct 2018, 09:20 Mark Kirkwood, <mark.kirkwood@catalyst.net.nz>
wrote:

> Hi,
>
> Definitely worth reading what the docs say about this, should clear
> things up:
> https://www.postgresql.org/docs/current/static/tutorial-transactions.html
>
> regards
>
> Mark
>
>
> On 15/10/18 15:30, prasanna rk wrote:
> > Hi all
> >
> > We are running posters 10.4 version, wanted to know if commit
> > statement is not required for update.
>
>
>
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Commit not required for update statement
@ 2018-10-15 05:58  David G. Johnston <david.g.johnston@gmail.com>
  parent: prasanna rk <prasanna2mail@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David G. Johnston @ 2018-10-15 05:58 UTC (permalink / raw)
  To: prasanna rk <prasanna2mail@gmail.com>; +Cc: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Sunday, October 14, 2018, prasanna rk <prasanna2mail@gmail.com> wrote:

> Does this mean..every statement which does not have begin will be
> automatically commited.
>

You should experiment in your chosen environment and see what does and
doesn’t work.

David J.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Commit not required for update statement
@ 2018-10-15 08:16  Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Mark Kirkwood @ 2018-10-15 08:16 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; prasanna rk <prasanna2mail@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Yeah - it matters whether you using psql client or python db api (for 
example) - as some of these decide to open a transaction immediately 
after a connection is established (via BEGIN) . So reading the docs and 
experimenting as indicated is essential!

regards

Mark


On 15/10/18 18:58, David G. Johnston wrote:
> On Sunday, October 14, 2018, prasanna rk <prasanna2mail@gmail.com 
> <mailto:prasanna2mail@gmail.com>> wrote:
>
>     Does this mean..every statement which does not have begin will be
>     automatically commited.
>
>
> You should experiment in your chosen environment and see what does and 
> doesn’t work.
>
> David J.
>





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-10-15 08:16 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 02:30 Commit not required for update statement prasanna rk <prasanna2mail@gmail.com>
2018-10-15 02:44 ` Evan Bauer <evanbauer@mac.com>
2018-10-15 03:49 ` Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
2018-10-15 05:06   ` prasanna rk <prasanna2mail@gmail.com>
2018-10-15 05:58     ` David G. Johnston <david.g.johnston@gmail.com>
2018-10-15 08:16       ` Mark Kirkwood <mark.kirkwood@catalyst.net.nz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox