Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8lqR-000156-3T for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 12:05:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8lqQ-0002fV-6X for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 12:05:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8lqP-0002fK-R0 for pgsql-general@lists.postgresql.org; Wed, 18 Apr 2018 12:05:49 +0000 Received: from mail.dbi-services.com ([195.70.1.167] helo=33229-ml-01.dfinet.ch) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8lqM-0007fe-EG for pgsql-general@postgresql.org; Wed, 18 Apr 2018 12:05:48 +0000 Received: from 33229-ml-01.dfinet.ch (localhost [127.0.0.1]) by 33229-ml-01.dfinet.ch (Postfix) with ESMTPS id E08E0CF77401 for ; Wed, 18 Apr 2018 14:05:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by 33229-ml-01.dfinet.ch (Postfix) with ESMTP id D45A6CF773FF for ; Wed, 18 Apr 2018 14:05:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at 33229-ml-01.dfinet.ch Received: from 33229-ml-01.dfinet.ch ([127.0.0.1]) by localhost (33229-ml-01.dfinet.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JXWsyjhL9oeR for ; Wed, 18 Apr 2018 14:05:37 +0200 (CEST) Received: from 33229-ml-01.dfinet.ch (33229-ml-01.dfinet.ch [10.128.30.2]) by 33229-ml-01.dfinet.ch (Postfix) with ESMTP id AE70ACF773FB for ; Wed, 18 Apr 2018 14:05:37 +0200 (CEST) Date: Wed, 18 Apr 2018 14:05:37 +0200 (CEST) From: Daniel Westermann To: pgsql-general@postgresql.org Message-ID: <1717499812.27146.1524053137683.JavaMail.zimbra@dbi-services.com> Subject: pg_locks.relation question MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_be8a1ac7-dd02-4fc9-967e-3629380854f5" X-Originating-IP: [92.104.112.131] X-Mailer: Zimbra 8.8.7_GA_1964 (ZimbraWebClient - FF59 (Linux)/8.8.7_GA_1964) Thread-Index: Thnc6Uxa9R+0P3jVNdl2oZijKxzXyA== Thread-Topic: pg_locks.relation question List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_be8a1ac7-dd02-4fc9-967e-3629380854f5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, session one: locks=# begin; BEGIN locks=# alter table test add column b text; ALTER TABLE locks=# Session 2 querying pg_locks for the PID from above: locks=# select locktype,relation::regclass,mode from pg_locks where pid = 2026 and locktype = 'relation'; locktype | relation | mode ----------+----------+--------------------- relation | test | AccessExclusiveLock relation | 17728 | AccessExclusiveLock relation | 17726 | ShareLock (3 rows) What are these 17728 and 17726 OIDs? Nothing else is happening except these two sessions. Thanks in advance Daniel --=_be8a1ac7-dd02-4fc9-967e-3629380854f5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,

session one:

locks=3D# begin;
BEGIN
locks=3D# alter table test add column b text= ;
locks=3D#

Ses= sion 2 querying pg_locks for the PID from above:

locks=3D# select locktype,relation::regc= lass,mode from pg_locks where pid =3D 2026 and locktype =3D 'relation';
&nb= sp;locktype | relation |        mode&nbs= p;       
----------+----------+-------= --------------
 relation | test     | AccessExclus= iveLock
 relation | 17728    | AccessExclusiveLock
&nbs= p;relation | 17726    | ShareLock
(3 rows)

What are these 17728 and 17726 OIDs? Nothing e= lse is happening except these two sessions.
<= div>
Thanks in advance
Daniel
--=_be8a1ac7-dd02-4fc9-967e-3629380854f5--