Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJUKk-0004HK-2B for pgsql-admin@arkaria.postgresql.org; Mon, 14 Feb 2022 05:55:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJUKi-00057u-U8 for pgsql-admin@arkaria.postgresql.org; Mon, 14 Feb 2022 05:55:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJUKi-00055I-B7 for pgsql-admin@lists.postgresql.org; Mon, 14 Feb 2022 05:55:32 +0000 Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nJUKe-0006RA-91 for pgsql-admin@lists.postgresql.org; Mon, 14 Feb 2022 05:55:31 +0000 Received: by mail-yb1-xb30.google.com with SMTP id y6so42958926ybc.5 for ; Sun, 13 Feb 2022 21:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=saama.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=zkeo0pB2jyb1iXdc7EMYg2v346EBRzJBDfWGjmMGvi8=; b=i7O/75q2YbxEHDqnK3lFzLKiDCEPAkcGI4+TLlhOXOuYQYjQqCPC0RfcTNqyNvWnj0 zl1v2x+RJJjd4bs2Q/cgvU9N+msQXEZaR+swspX8/77wDeiGQdwlZORfntu0izOzVzc7 mO1ySKWREmoiUP1VnzrbIzc3ODR04eZ+LD/xY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zkeo0pB2jyb1iXdc7EMYg2v346EBRzJBDfWGjmMGvi8=; b=wn5H8qqOlq3skkJyM+sXu55k1lYt4OoOGydK/wkV7Un47kA8zYyH0mlP6jQIbULjsy 0g3S40/GRywoz3VEy6hhU17C6HE5j4OLJWwZUyyPGbCs9X8Aiawgt2BgEd4BUvLoD9ir geoupFUYc2J/oWItKgFFPqeWgWd6Ufo4zVJmRneD/K5bfa0NclmnmR4xRmScahzm3iob X5pJYICAZXXir9Pg9S+m/Wb9qv6laHT2uWIdzfbQbb4Bw7iQww4NcbviSxi/4CbXQQ+1 Rjf2/gg5gIimK+kjqGioWlTOzxtc0ncuiCZ0MFhzrjqGldwkJoBKulz+I8T6sfpN/sP/ l8Zw== X-Gm-Message-State: AOAM531OCKdKf96clx2IHayAdTdXSfl3FBfy1QWkAMNuJb6IkmM56YQf nBLidko3Vn3oidiZ48zjY0S25OgMnc4XLm6aArtLdKcoDXyUQBISY2aNYoSd+AKhdd/Q4PwxFI3 /+b6YV9sfslCzedVPoCIFH6RYrrsksjXN6wIaaw8L8qg= X-Google-Smtp-Source: ABdhPJxVWhXFiEza6KtfYoYyZzF5CZE4UsDxyQiRzcQEsP5fAC0kYPz4CPEXRzBMhQvUEBr8JvBXo5HT2zAXu7Dz/C0= X-Received: by 2002:a25:3404:: with SMTP id b4mr10602281yba.592.1644818126350; Sun, 13 Feb 2022 21:55:26 -0800 (PST) MIME-Version: 1.0 From: Gaurav Anand Date: Mon, 14 Feb 2022 11:24:17 +0530 Message-ID: Subject: PG10 Attach-Detach Partition in Declarative vs Inheritance To: pgsql-admin@postgresql.org, pgsql-admin Content-Type: multipart/alternative; boundary="00000000000024545205d7f41016" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000024545205d7f41016 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Team, I need your kind suggestion: We have Postgres 10 and have partition tables currently with Declarative partitions. When we refresh the data and detach and attach the partition, during this time our Application which has Sql query on these tables takes Lock and sometimes a deadlock situation also arises. To overcome deadlock we used, advisory lock however the application still keeps waiting for lock to release. Please suggest the best way - 1. Will Inheritance partition (in PG10) help avoid the explicit locks. 2. Is upgrading the only choice? if so which version of PG. 3. Please suggest any other work around. Thanks. Regards, Gaurav Anand [image: logo] --=20 This communication is confidential and subject to and governed by=C2=A0Saama=E2=80=99s=C2=A0 Electronic Communications Disclaimer.=20 =C2=A0 --00000000000024545205d7f41016 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

I need your kind suggestion:We have Postgres 10 and have partition=C2=A0tables currently with Declara= tive partitions. When we refresh the data and detach and attach the partiti= on, during this time our Application which has Sql query on these tables ta= kes Lock and sometimes a deadlock situation also arises.
=C2=A0
To overcome deadlock we used, advisory lock however=C2=A0the appli= cation still keeps waiting for lock to release.

Pl= ease suggest the best way -=C2=A0
1. Will Inheritance partition (= in PG10) help avoid the explicit=C2=A0locks.
2. Is upgrading the = only choice? if so which version of PG.
3. Please suggest any oth= er work around.

Thanks.

=
Regards,
Gaurav Anand
3D"logo"

This communication is confidential and subject to and governed by=C2=A0Saama=E2=80=99s=C2=A0Electronic Communications Disclaimer.

=C2=A0

--00000000000024545205d7f41016--