Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XoNdo-0006GV-0t for pgsql-admin@arkaria.postgresql.org; Wed, 12 Nov 2014 02:26:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XoNdm-0007kY-Vz for pgsql-admin@arkaria.postgresql.org; Wed, 12 Nov 2014 02:26:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XoNdk-0007kP-Ub for pgsql-admin@postgresql.org; Wed, 12 Nov 2014 02:26:37 +0000 Received: from zql.com ([206.222.31.58]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XoNdb-0004RE-14 for pgsql-admin@postgresql.org; Wed, 12 Nov 2014 02:26:35 +0000 Received: from localhost ([127.0.0.1]) by zql.com with smtp (Exim 4.68) (envelope-from ) id 1XoNdX-0000HS-Bh; Tue, 11 Nov 2014 21:26:23 -0500 From: "Greg Sabino Mullane" To: pgsql-admin@postgresql.org Subject: Re: pg_repack issues X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: Date: Wed, 12 Nov 2014 02:26:23 -0000 X-Mailer: JoyMail 3.0.1 Message-ID: <8b20bab72ec52ccdfa256be7ec739d41@biglumber.com> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Mark Steben wrote: > ERROR: query failed: ERROR: value "3048471620" is out of > range for type integer > DETAIL: query was: SELECT pg_try_advisory_lock($1, $2) > > This happens because the oid values of the tables is this database are > all over 2 GB. Can I get some insight to make pg_repack work in this > situation? That was an unfortunate choice they made in having their second (int) argument be an OID. A quick fix would be to have it use the single (bigint) form of pg_try_advisory_lock. Something like this (untested): diff --git a/bin/pg_repack.c b/bin/pg_repack.c index af510ca..d638164 100644 - --- a/bin/pg_repack.c +++ b/bin/pg_repack.c @@ -1520,13 +1520,12 @@ static bool advisory_lock(PGconn *conn, const char *relid) { PGresult *res = NULL; bool ret = false; - - const char *params[2]; + const char *params[1]; - - params[0] = REPACK_LOCK_PREFIX_STR; - - params[1] = relid; + params[0] = relid; - - res = pgut_execute(conn, "SELECT pg_try_advisory_lock($1, $2)", - - 2, params); + res = pgut_execute(conn, "SELECT pg_try_advisory_lock($1)", + 1, params); if (PQresultStatus(res) != PGRES_TUPLES_OK) { elog(ERROR, "%s", PQerrorMessage(connection)); You also may want to raise this as an official issue here: https://github.com/reorg/pg_repack/issues - -- Greg Sabino Mullane greg@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201411112120 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iEYEAREDAAYFAlRixSsACgkQvJuQZxSWSsjuFwCfRvWEMeP3Rnb7F0HuRvIMNKwi wNwAoPq3Sg6Q64C2tK/FdLdTHBo3zqlm =DiA9 -----END PGP SIGNATURE----- -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin