Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X1hiG-00031K-IH for pgsql-performance@arkaria.postgresql.org; Mon, 30 Jun 2014 19:58:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X1hiG-0000P7-2m for pgsql-performance@arkaria.postgresql.org; Mon, 30 Jun 2014 19:58:04 +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 1X1hiF-0000P1-4J for pgsql-performance@postgresql.org; Mon, 30 Jun 2014 19:58:03 +0000 Received: from smtp128.ord.emailsrvr.com ([173.203.6.128]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X1hiC-00007O-8o for pgsql-performance@postgresql.org; Mon, 30 Jun 2014 19:58:01 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp17.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id 49FE9380507; Mon, 30 Jun 2014 15:57:59 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp17.relay.ord1a.emailsrvr.com (Authenticated sender: jeff.frost-AT-pgexperts.com) with ESMTPSA id 32124380505; Mon, 30 Jun 2014 15:57:58 -0400 (EDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_43CEE498-2B17-429D-8912-989FDFE9A399" Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: Postgres Replaying WAL slowly From: Jeff Frost In-Reply-To: Date: Mon, 30 Jun 2014 12:57:56 -0700 Cc: Tom Lane , Andres Freund , Soni M , Heikki Linnakangas , pgsql-performance Message-Id: References: <53AFCEE3.4080009@vmware.com> <53B10C4C.8090701@vmware.com> <53B18CE0.4060501@vmware.com> <20140630171416.GK21422@awork2.anarazel.de> <8DA8C140-818D-4184-AAE6-CA37278B983C@pgexperts.com> <20140630183908.GT26930@awork2.anarazel.de> <0A7B96D4-DB10-49A8-A268-F28960F2E137@pgexperts.com> <20300.1404156750@sss.pgh.pa.us> To: Matheus de Oliveira X-Mailer: Apple Mail (2.1878.2) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --Apple-Mail=_43CEE498-2B17-429D-8912-989FDFE9A399 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jun 30, 2014, at 12:54 PM, Matheus de Oliveira = wrote: >=20 > On Mon, Jun 30, 2014 at 4:42 PM, Jeff Frost = wrote: > And if you go fishing in pg_class for any of the oids, you don't find = anything: >=20 > That is probably because you are connected in the wrong database. Once = you connect to the database of interest, you don't even need to query = pg_class, just cast relation attribute to regclass: >=20 > SELECT relation::regclass, ... > FROM pg_locks WHERE database =3D (SELECT oid FROM pg_database = WHERE datname =3D current_database()); >=20 Yah, i thought about that too, but verified I am in the correct DB. = Just for clarity sake: SELECT relation::regclass FROM pg_locks WHERE database =3D (SELECT oid FROM pg_database WHERE = datname =3D current_database()) and mode =3D 'AccessExclusiveLock'; relation ------------ 3245508214 3245508273 3245508272 3245508257 3245508469 3245508274 3245508373 3245508468 3245508210 3245508463 3245508205 3245508260 3245508265 3245508434 (16 rows)= --Apple-Mail=_43CEE498-2B17-429D-8912-989FDFE9A399 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
On Jun 30, 2014, at 12:54 PM, Matheus de Oliveira <matioli.matheus@gmail.com> wrote:


On Mon, Jun 30, 2014 at 4:42 PM, Jeff Frost <jeff@pgexperts.com> wrote:
And if you go fishing in pg_class for any of the oids, you don't find anything:

That is probably because you are connected in the wrong database. Once you connect to the database of interest, you don't even need to query pg_class, just cast relation attribute to regclass:

    SELECT relation::regclass, ...
    FROM pg_locks WHERE database = (SELECT oid FROM pg_database WHERE datname = current_database());



Yah, i thought about that too, but verified I am in the correct DB.  Just for clarity sake:

SELECT relation::regclass
    FROM pg_locks WHERE database = (SELECT oid FROM pg_database WHERE datname = current_database()) and mode = 'AccessExclusiveLock';

  relation
------------


 3245508214
 3245508273
 3245508272
 3245508257
 3245508469
 3245508274
 3245508373
 3245508468
 3245508210
 3245508463
 3245508205
 3245508260
 3245508265
 3245508434
(16 rows)
--Apple-Mail=_43CEE498-2B17-429D-8912-989FDFE9A399--