Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XcFDq-000569-2V for pgsql-sql@arkaria.postgresql.org; Thu, 09 Oct 2014 15:01:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XcFDp-0007aE-6H for pgsql-sql@arkaria.postgresql.org; Thu, 09 Oct 2014 15:01:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XcFDo-0007Zy-6Q for pgsql-sql@postgresql.org; Thu, 09 Oct 2014 15:01:40 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XcFDj-0007Hk-IP for pgsql-sql@postgresql.org; Thu, 09 Oct 2014 15:01:38 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by gateway2.nyi.internal (Postfix) with ESMTP id 2D34620409 for ; Thu, 9 Oct 2014 11:01:34 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 09 Oct 2014 11:01:34 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= x-sasl-enc:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=pZorLd1MTp5dMWU1mReSG94TAXU=; b=Jxtg6Aq1oqctxAXxKm Hge1q3HmgwR1JWlYZHN/1gLUk28/GNC8QY4EyZNMwtpjCUZp24eV7jbI/aZN3Ht8 Up6KVN//T52YrK7MHWIrfbEEAJC53sBXrskwIskLZIp2xVLdq9WSDhY/tsTiZ1kh YkVm/jLeajNDEL7Mi25rmsyfk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=pZorLd1MTp5dMWU1mReSG9 4TAXU=; b=MI/QOZgovNqbbEkcH+fGgpzY1q0ZoerAJppMG/ibJT2tkau7SGFTxi v9njemaIAD/7axSaLfnzfBo8EuwxRV519MD9+xEDUsNyO67cFYvIZ7fqf9KJWeFQ XeZexZt15XHxZ8vG1u4acRSxHvL5LdPgVUnw4Rt+Ho9VbKPSYJLXM= X-Sasl-enc: JwYNDogZrR84LokkeAY48cSpY8B89ToiQU+lhaP4KnTV 1412866893 Received: from [192.168.1.5] (unknown [97.113.18.230]) by mail.messagingengine.com (Postfix) with ESMTPA id AF7A9C0000A; Thu, 9 Oct 2014 11:01:33 -0400 (EDT) Message-ID: <5436A34C.8090306@aklaver.com> Date: Thu, 09 Oct 2014 08:01:32 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: jim_yates , pgsql-sql@postgresql.org Subject: Re: could not access status of transaction pg_multixact issue References: <1412791213607-5822248.post@n5.nabble.com> <20141008185538.GY7043@eldon.alvh.no-ip.org> <1412797415000-5822268.post@n5.nabble.com> <20141008205416.GZ7043@eldon.alvh.no-ip.org> <1412863620263-5822376.post@n5.nabble.com> In-Reply-To: <1412863620263-5822376.post@n5.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 10/09/2014 07:07 AM, jim_yates wrote: > 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 > > Casting issue, try: update pg_database set datminmxid='21973' where datname='production-copy'; > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql