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 1s29ZA-000Qzd-Qx for pgsql-bugs@arkaria.postgresql.org; Wed, 01 May 2024 13:00:08 +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 1s29Z7-00CaEH-Kc for pgsql-bugs@arkaria.postgresql.org; Wed, 01 May 2024 13:00:06 +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 1s29Z7-00CaE8-C4 for pgsql-bugs@lists.postgresql.org; Wed, 01 May 2024 13:00:06 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s29Z5-000vxg-TT for pgsql-bugs@lists.postgresql.org; Wed, 01 May 2024 13:00:05 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2db13ca0363so108843511fa.3 for ; Wed, 01 May 2024 06:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714568402; x=1715173202; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=H+apsRj3UlTPW5wgIGkvXv+0fLX2q1v+i7gwB5FJVrA=; b=KwCuGKR7ZDqP9z2INBwQn2QXNhXprOa/cLVjirFXz2ENj/TfFLsqxaMGubmvxvoF/O GVbHcUf7cmDNGGwPBy9lYc/f/Gz/g5xq0aSUd0rVzKwBROpf03K1rzlDEcDeqX5kG5/Z NlpmtPZxJqGotc7jOAbDwPVo9SWTvXwx2Uz/B+GLT+a55fPQ2Jb6LqvJjX9cR4GpOWFg BC054baZWZBWYBcPyOexnAZk8wzla+j992O3XjqSrw1k1vIZRFWWL3PSqNqYNJlnlm7/ l9dvLGeGmBWugVs5vXgigoxKTHGGrOJm/pw2lOEsVZM76HzJG2N3IKmTcgTCEnLm9G2h 9P1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714568402; x=1715173202; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H+apsRj3UlTPW5wgIGkvXv+0fLX2q1v+i7gwB5FJVrA=; b=hEMyEfh0FoqAb1IoLrT0iN1RKBTIlJC+45rD4lCHJUpgz1iOfjvuPLhRWG/xi+fhRt 5tgfnD243enM0K5VCgzVL4aa+wFn9b3wO+V8RRZKwIvLUKbj96/QhZQMaxp1mpanjX8f 7c86Y3UygAyC0/2N9PYQN8gh3whtcAAN2Vtpnc1cWVfPeGpVPGAWMzCWV6Zq+0OdIf6z paV66HOWWFLKvoKx2OHi9PCZXMgzxFnJsLJzaadiGtrHGfxSHfnTtgfb1W7A5OYqA3rE 2x09hA/YdxkSK+6cM6ov3SACjE32G+jqjAUDrBJF8dV80V5u208mhR9Z6DWaokjAcTNh 2UMw== X-Gm-Message-State: AOJu0YzedT5/maX5n3t2UFcs99lSZoiO4K0VSUpd9/gat7hkdAuB1AAj CId1ihcdWGbjKuHVg2Zj8a24mtqYyQvmdWHgVozj7CfL/nd8GVvB X-Google-Smtp-Source: AGHT+IE6TgZ5iSv34bjRxNl0mSLL5nPpSVH+Ftr+qIMDRI9OuBzlA3kNYX9F99IKLJQgTvLzrXn9yw== X-Received: by 2002:a05:651c:a10:b0:2e0:da20:2502 with SMTP id k16-20020a05651c0a1000b002e0da202502mr2183866ljq.49.1714568401950; Wed, 01 May 2024 06:00:01 -0700 (PDT) Received: from [1.0.0.7] ([178.155.23.194]) by smtp.gmail.com with ESMTPSA id x22-20020a2e7c16000000b002d9e3a525bfsm4209597ljc.41.2024.05.01.06.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 May 2024 06:00:01 -0700 (PDT) Message-ID: <548a47bc-87ae-b3df-c6a2-60b9966f808b@gmail.com> Date: Wed, 1 May 2024 16:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #18449: Altering column type fails when an SQL routine depends on the column Content-Language: en-US To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut References: <18449-f8248467aaa294d5@postgresql.org> <403599.1714268901@sss.pgh.pa.us> From: Alexander Lakhin In-Reply-To: <403599.1714268901@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Tom, 28.04.2024 04:48, Tom Lane wrote: > Thanks for the report. It looks like most of the other hard cases > in RememberAllDependentForRebuilding just error out with code > along the lines of > > ereport(ERROR, > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("cannot alter type of a column used by a view or rule"), > > I'm inclined to do likewise for functions. I've discovered one more case, presumably as hard as the other ones: CREATE TABLE t(a int); CREATE PUBLICATION p FOR TABLE t WHERE (a > 0); ALTER TABLE t ALTER COLUMN a TYPE bigint; fails with: ERROR:  unexpected object depending on column: publication of table t in publication p Reproduced on REL_15_STABLE (52e4f0cd4) .. master. > We could imagine trying > to re-parse the function definition against the new column type, > but there are way too many ways for that to go wrong. Just for > starters, there are possibly-security-grade hazards if the current > search_path isn't what it was when the function was created. There's > no guarantee that we'd succeed anyway, eg the new column type might > not work for some function or operator that's applied to it, and if > not the resulting error message would likely be very surprising. It looks like all these considerations apply to expressions defining row filters for publications... Best regards, Alexander