From daniel.westermann@dbi-services.com Wed Apr 18 12:05:37 2018 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-- From pavan.deolasee@gmail.com Wed Apr 18 12:16:07 2018 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 1f8m0n-0001mw-5K for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 12:16:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8m0l-0003jB-WA for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 12:16:31 +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 1f8m0l-0003j1-Kf for pgsql-general@lists.postgresql.org; Wed, 18 Apr 2018 12:16:31 +0000 Received: from mail-ot0-x234.google.com ([2607:f8b0:4003:c0f::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f8m0i-0007tb-Op for pgsql-general@postgresql.org; Wed, 18 Apr 2018 12:16:30 +0000 Received: by mail-ot0-x234.google.com with SMTP id v64-v6so1619412otb.13 for ; Wed, 18 Apr 2018 05:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=csud6dld9/Wsk1wh6iQsOcdeQaVVpnoXiHCWeOUlvPw=; b=DZq4wQ1BsBgjpthVUTFvgfcy1boGMP0sGmuxoCijcfJMUu2LVzC8LQfp1IXT2yRbuh Tp/SFSGDf6Bhrb6Np7vM2gtt2hm68/5Z/ys1kErw+xA3xSE+Bmb3JEaJTBZcoI7Od5D3 O1d+noQ5GECafCBPE8zgfek3QKYOUkiBu6kqBrIKlGWjX+doLBsHIdQ4VL24+Q6yV029 nzJDx5Q/ErniirpSPNJ2N4D4MamIvi6Sy5OVu5ZTVmPLn8AU8ok6mnQTTJ+mq8nTCMhj wpvpWw4mvNsIaQ0qkzcc+vG46fbWA9xgMAW6gyedn9ZMIq4jp5TlQdcg85dZWODugnvM S8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=csud6dld9/Wsk1wh6iQsOcdeQaVVpnoXiHCWeOUlvPw=; b=hri4Kr6JYjMHO/2dktH0Pci32l+DnM0XBn79PQA2yYhbzINzBuaOAsIhM0OBdx9dGQ o7gJxjkkRLTM5S9Uu69fy/okVgn6CPISTCU8UzSLaS/xKax066BwfdXmkkoncTdWcctc 2lUnJssAprP/haXnpJlD93oWsxI5uLITK6R80P3aBHyWHNMGaG0/dKLaIEJT/eNgrjMo MlV9Gx1uyVWjOaBrDp+7cIaER0UK5ix1PvEUv+aa9y4Ifr6d9RoE8brdt8uG/jPjz/gd 9DJkXLroOwnPj9RYWJm4xM4X+2TdODZc7/DOmlwSpr8EZMMkQ+P7nLq7fQ6LeiptNsav CuUg== X-Gm-Message-State: ALQs6tCDFFdQXoPBGQ6B9+UIeDXwvle/RGzDNq5LWKMAouueE+57wOro G0SqwrtSftUfUQWzexjgpvpEEb0gmY2zX0Q45EfuFg== X-Google-Smtp-Source: AIpwx496e5Z5ijR6rSmiiUyhCH3mtBTOjscFBdaSp/s6tel/UDmn+3TlJ8wGK1d6j7Q0g2JDyNAG38mRhEHmJjmDLl4= X-Received: by 2002:a9d:20a3:: with SMTP id x32-v6mr1123060ota.311.1524053788031; Wed, 18 Apr 2018 05:16:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.211.7 with HTTP; Wed, 18 Apr 2018 05:16:07 -0700 (PDT) In-Reply-To: <1717499812.27146.1524053137683.JavaMail.zimbra@dbi-services.com> References: <1717499812.27146.1524053137683.JavaMail.zimbra@dbi-services.com> From: Pavan Deolasee Date: Wed, 18 Apr 2018 17:46:07 +0530 Message-ID: Subject: Re: pg_locks.relation question To: Daniel Westermann Cc: Pgsql General list Content-Type: multipart/alternative; boundary="000000000000a78a15056a1e6cb6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000a78a15056a1e6cb6 Content-Type: text/plain; charset="UTF-8" On Wed, Apr 18, 2018 at 5:35 PM, Daniel Westermann < daniel.westermann@dbi-services.com> wrote: > 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. > > Those are probably the OIDs of the toast table and the index on it. If you commit the transaction running in Session 1 and then query pg_class for those OIDs, you might see more details. Of course, I am just guessing without looking into much detail. Thanks, Pavan -- Pavan Deolasee http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --000000000000a78a15056a1e6cb6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Apr 18, 2018 at 5:35 PM, Daniel Westermann &l= t;d= aniel.westermann@dbi-services.com> wrote:
Hi,

session o= ne:

locks=3D# begi= n;
BEGIN
locks=3D# alter table test add column b text;
ALTER TABLE
locks= =3D#

Session 2 querying pg_locks for the PID from= above:

locks=3D# = select locktype,relation::regclass,mode from pg_locks where pid =3D 20= 26 and locktype =3D 'relation';
=C2=A0locktype | relation |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mo= de=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
----------+----------+---------------------=C2=A0relation | test=C2=A0=C2=A0=C2=A0=C2=A0 = | AccessExclusiveLock
=C2=A0relation = | 17728=C2=A0=C2=A0=C2=A0 | AccessExclusiveLock
=C2=A0relation | 17726=C2=A0=C2=A0=C2=A0 | ShareLock
<= span style=3D"font-family:"courier new",courier,monaco,monospace,= sans-serif;font-size:10pt">(3 rows)

What are these= 17728 and 17726 OIDs? Nothing else is happening except these two sessions.=


Those= are probably the OIDs of the toast table and the index on it. If you commi= t the transaction running in Session 1 and then query pg_class for those OI= Ds, you might see more details. Of course, I am just guessing without looki= ng into much detail.=C2=A0

= Thanks,
Pavan

--
=C2=A0Pavan Deolasee =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.2ndQuadrant.com/
=C2=A0Po= stgreSQL Development, 24x7 Support, Training & Services
--000000000000a78a15056a1e6cb6-- From daniel.westermann@dbi-services.com Wed Apr 18 12:24:02 2018 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 1f8m8A-0002H1-K3 for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 12:24:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8m89-0008NT-BP for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 12:24:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8m89-0008NI-3H for pgsql-general@lists.postgresql.org; Wed, 18 Apr 2018 12:24:09 +0000 Received: from mail.dbi-services.com ([195.70.1.167] helo=33229-ml-01.dfinet.ch) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8m85-0005ye-T9 for pgsql-general@postgresql.org; Wed, 18 Apr 2018 12:24:08 +0000 Received: from 33229-ml-01.dfinet.ch (localhost [127.0.0.1]) by 33229-ml-01.dfinet.ch (Postfix) with ESMTPS id CEB63C0720D9; Wed, 18 Apr 2018 14:24:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by 33229-ml-01.dfinet.ch (Postfix) with ESMTP id C0EE3C0720DC; Wed, 18 Apr 2018 14:24:03 +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 fcLiqieCUnEX; Wed, 18 Apr 2018 14:24:03 +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 99939C0720D9; Wed, 18 Apr 2018 14:24:03 +0200 (CEST) Date: Wed, 18 Apr 2018 14:24:02 +0200 (CEST) From: Daniel Westermann To: Pavan Deolasee Cc: Pgsql General list Message-ID: <1794030567.31110.1524054242271.JavaMail.zimbra@dbi-services.com> In-Reply-To: References: <1717499812.27146.1524053137683.JavaMail.zimbra@dbi-services.com> Subject: Re: pg_locks.relation question MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_27bbb55a-08d0-445a-92bc-70740d7ffdc6" X-Originating-IP: [92.104.112.131] X-Mailer: Zimbra 8.8.7_GA_1964 (ZimbraWebClient - FF59 (Linux)/8.8.7_GA_1964) Thread-Topic: pg_locks.relation question Thread-Index: 9HfzV+Vc2Qm54DiIvhGwsGPBJMG7aw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_27bbb55a-08d0-445a-92bc-70740d7ffdc6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On Wed, Apr 18, 2018 at 5:35 PM, Daniel Westermann < [ mailto:daniel.westermann@dbi-services.com | daniel.westermann@dbi-services.com ] > wrote: 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. >>Those are probably the OIDs of the toast table and the index on it. If you commit the transaction running in Session 1 and then query >>pg_class for those OIDs, you might see more details. Of course, I am just guessing without looking into much detail. Thx, Pavan, that's it. --=_27bbb55a-08d0-445a-92bc-70740d7ffdc6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Wed, Apr 18, 2018 at 5:35 PM, Daniel Westermann &l= t;d= aniel.westermann@dbi-services.com> wrote:
<= div style=3D"font-family:arial,helvetica,sans-serif;font-size:12pt;color:#0= 00000">
Hi,

session one:

locks=3D# begin;
BE= GIN
locks=3D# alter table test add co= lumn b text;
ALTER TABLE
locks=3D#

Session 2 que= rying pg_locks for the PID from above:

locks=3D# select locktype,relation::regclass,mode from pg_locks w= here pid =3D 2026 and locktype =3D 'relation';
 locktype | relation |      &n= bsp; mode        
----------+----------+--------------------- relation | test     = | AccessExclusiveLock
 relation = | 17728    | AccessExclusiveLock
 relation | 17726    | ShareLock
<= span style=3D"font-family:"courier new",courier,monaco,monospace,= sans-serif;font-size:10pt">(3 rows)

What are these= 17728 and 17726 OIDs? Nothing else is happening except these two sessions.=


>>Those are probably = the OIDs of the toast table and the index on it. If you commit the transact= ion running in Session 1 and then query >>pg_class for those OIDs, yo= u might see more details. Of course, I am just guessing without looking int= o much detail. 

Thx, Pavan, that's it.




=
--=_27bbb55a-08d0-445a-92bc-70740d7ffdc6--