Re: could not access status of transaction pg_multixact issue

From: jim_yates <pg(at)wg5jim(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: could not access status of transaction pg_multixact issue
Date: 2014-10-09 14:07:00
Message-ID: 1412863620263-5822376.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Alvaro Herrera-9 wrote
> jim_yates wrote:
>
>> > A better way not involving mxid_age() would be to use pg_controldata to
>> > extract the current value of the mxid counter, then subtract the
>> current
>> > relminmxid from that value.
>>
>>
>> It's not clear which lines from pg_controldata to use for updating
>> pg_database.datminmxid.
>
> The one labelled NextMultiXactId.
>
>> I also assume I would do the pg_database update on a idle database.
>
> It doesn't matter, actually. pg_database is a shared catalog, so an
> update would affect all the databases.
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services

I tried doing the update to pg_database on my Dev server and I can't get it
to work. How do I calculate the new datminmxid value?

NextMultiXactId: 30349 relminmxid from pg_class for the table: 8376

If I subtract the relminmxid from the nextmulixact I get 21793 which won't
work.

production-copy=# update pg_database set datminmxid=21973 where
datname='production-copy';
ERROR: column "datminmxid" is of type xid but expression is of type integer

--
View this message in context: http://postgresql.1045698.n5.nabble.com/could-not-access-status-of-transaction-pg-multixact-issue-tp5822248p5822376.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2014-10-09 15:01:32 Re: could not access status of transaction pg_multixact issue
Previous Message jim_yates 2014-10-08 21:26:46 Re: could not access status of transaction pg_multixact issue