Re: Postgresql 9.5 committing and log sequence number

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Poul Kristensen *EXTERN*'" <bcc5226(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Postgresql 9.5 committing and log sequence number
Date: 2016-11-15 13:13:26
Message-ID: A737B7A37273E048B164557ADEF4A58B5397E74D@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Poul Kristensen wrote:
> How come that repeating
> SELECT txid_current();
>
> makes 1 added to xid
> shown by
> select * from pg_last_committed_xact();
>
>
> repeating
>
> select * from pg_last_committed_xact();
>
> does not add 1 for each repeat of
> select * from pg_last_committed_xact();

The documentation says about txid_current():

get current transaction ID, assigning a new one if the current transaction
does not have one

Since the query runs in ist own transaction, each invocation
will assign a new transaction ID.

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Campbell, Lance 2016-11-16 23:45:57 table - on delete - how to insert a record into a different table
Previous Message Poul Kristensen 2016-11-15 12:49:33 Re: Postgresql 9.5 committing and log sequence number