Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHpB5-00B2UO-5Y for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2024 18:28:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sHpB2-005L8k-Vq for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jun 2024 18:28:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sHpB2-005L8c-LS for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2024 18:28:01 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHpB0-0019ts-Ph for pgsql-hackers@lists.postgresql.org; Thu, 13 Jun 2024 18:28:00 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a6f1c4800easo181471566b.3 for ; Thu, 13 Jun 2024 11:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718303277; x=1718908077; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GjvwmXUOcWb6N/kh98Mb+dju+Mhsn3frZRLtzT7bBoI=; b=OWlf/5JYnkXkHMFldaYdW4nzvcw1QqOGExD9VrnMDaH+Zyc9YtsVBXz6UVTSU0XJXz NtEKFh8TYDSIIHJ/ZAKJ5kUrZaX1kGy+tzkG5FQshMDRdxJi9wNJk+MY3PkttflaldoD q4qFk2uquncdITWVMPz3xPKUM/T5o8tE90YFvv/OmIq35SpHKivj6j4AeVwHXl7bz+9I x22IoAJl800oMPlZyctE5h3IPC/KD/PrgeEad9VS/0I7vAfUBX2Hq4fasXhre162yc90 +o/D2ERPat1nPuJVAMmTTXZliJoRMRCyzuUt8ClX6WRiEntHPdpjvMuB03RJiMtk4Gb/ yp8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718303277; x=1718908077; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GjvwmXUOcWb6N/kh98Mb+dju+Mhsn3frZRLtzT7bBoI=; b=UZqK+ul/DjbjfttRnFszZjYEnB82Bg0km7v4L3UdkwYnWlZzvr0UJO/Qo4cB7IMPZu m7HV7X/U0mJzEQ6dZEci00u9SEHVJabUPj2HIAVt4D+sLsUSse8noHOekzYDQYOIjt7y zl/0QgXAAjkdBZJip4RcjOGGyX1XUzfipnAyxfxeSXSB4RJ7FBQnlj69p1VEJ9muBLHy hxs+hLP2qPU+EsBIbb/HYND8M/SG9T7XRWQs+txxcVYs/UXIF4Uip1ymqUO2wZ9Z8uca B2+Ehq15yCOJCOrOFHMsxOhGDba39Ggo/xwo8b9kfqRy01QWsDun/VsoQi9ZjKsORUDx aU6Q== X-Forwarded-Encrypted: i=1; AJvYcCWdO/70X1EVlS2NY8llr9Boy8rTjOnDV3yL3lA57MFNC9gFLeU6i0mF6DpeuHl8OjY4HX7gTIWC4Ibr38yWYzhXAEMMkBGLFoSTrW2UMrEetNcu X-Gm-Message-State: AOJu0Yx26zNse2Dr+qGIWAJmKauzcDeWDgSQdT/4AMkbtw78rrvV25Hh FeYgJcLkqTn4Kn3Cx2kxZP99uOFjfYogPjINZAAFzncD/2WOkcIsfLOZvENCRsa8q+Z0T8uLJdF uPvhR14MrQ+pO1wolVmp7284xzGY= X-Google-Smtp-Source: AGHT+IGSNF3ogojZfAx1zKB+Re1jGio/OunzK/2RFzqK3BOZChoh9ADXf5RSje4WFBi37N8R/SR9DY7NjFowNZcWZGY= X-Received: by 2002:a17:907:1c1d:b0:a6f:576e:4d32 with SMTP id a640c23a62f3a-a6f60cf4310mr51059066b.4.1718303277111; Thu, 13 Jun 2024 11:27:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Haas Date: Thu, 13 Jun 2024 14:27:45 -0400 Message-ID: Subject: Re: Avoid orphaned objects dependencies, take 3 To: Bertrand Drouvot Cc: Michael Paquier , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tom Lane Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 13, 2024 at 12:52=E2=80=AFPM Bertrand Drouvot wrote: > > > table_open(childRelId, ...) would lock any "ALTER TABLE = DROP CONSTRAINT" > > > already. Not sure I understand your concern here. > > > > I believe this is not true. This would take a lock on the table, not > > the constraint itself. > > I agree that it would not lock the constraint itself. What I meant to say= is that > , nevertheless, the constraint can not be dropped. Indeed, the "ALTER TAB= LE" > necessary to drop the constraint (ALTER TABLE DROP CONSTRAIN= T) would > be locked by the table_open(childRelId, ...). Ah, right. So, I was assuming that, with either this version of your patch or the earlier version, we'd end up locking the constraint itself. Was I wrong about that? --=20 Robert Haas EDB: http://www.enterprisedb.com