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 1sXUeq-004KU3-9i for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jul 2024 23:47:32 +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 1sXUeo-001Atv-St for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jul 2024 23:47:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sXUeo-001Atm-E6 for pgsql-hackers@lists.postgresql.org; Fri, 26 Jul 2024 23:47:30 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sXUem-001eqi-15 for pgsql-hackers@postgresql.org; Fri, 26 Jul 2024 23:47:29 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-70d2d7e692eso1305185b3a.0 for ; Fri, 26 Jul 2024 16:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1722037645; x=1722642445; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=nyhD0j8yFVsxpTHZMEvlP52S0R1LJcSUlkLj/PJOeQg=; b=GoWbfNtG25j5i70DlQA2T5VIZOMNyJb5cUfJ8Qqg30FCb/GoryJK0OQoI/ke09SVvG Sx0sq8VuvwcuORVUQzd7G1fyNv8a3huf3HAZlMz9foEsnbpkHVjsN7biOgblMNW8ecaB ILyLAeDKRiSPiPakjF6LYc4i8sioOH9PgVqg3RkHprq9RKmZO0slpXgGlPijldWVJg2K sTBsOLoXtxL2gayfnUCQIo+43UVsc9jr+qO1IE7VcHWt7NqRvQ6STUhLc6aXObSN8se2 3YToBRoLkfQ+cE1IdgqQnaOJ7HEwuLIurXBIeWIqlVC5gAX+foeCThWhrg2XeXIYPRUQ fdaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722037645; x=1722642445; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nyhD0j8yFVsxpTHZMEvlP52S0R1LJcSUlkLj/PJOeQg=; b=mbBVOI6G0xH54JXyWrOjIlSkSotrWPzL7vTIHri2z1fmJ647C5J+VXZhWjusUbUVAK VsUkapZZsGOUW+EHe2c0VP5YdZj9g1BWjCtADtCJAQiG4YVPTiAEsUf/8AlBPXDH9L1n oppxuadRBYABm1cIKeKuoy1qIPfMW8kvgGJ+J8+KuCaQG9UnrZwefIXwncErqIf5bPId kJOcqfrSCZdQxPITicekKhBC6hMjzE1Zi6IoqPnlqe2Tp8NxoaxLfu5pn6wSeD0kFYfv 2hvWb4IDkAPIT6fWHppdb93vhVIV7/44r7OlR3xEiB9ICgk7cqoD8GAq+2Oa+wZIxgCL Ppcg== X-Forwarded-Encrypted: i=1; AJvYcCWK3Xtfu3pIwSKswS4rhXETfg3Jtkd3XKrDq/qzy7MwGmp1xU/ndtPx8E0WEqEYUzGWjdc+DssZc1Pj2iYLZcixohBzrjUMXVtbZIqL X-Gm-Message-State: AOJu0YwI+jiaJ326oi48CAvuWctPfSG5MjlvZa6wsJ9zklFlaBYgtaSg nUcYymywl/vKvm8PeQp0RmurpR0iuzgfRFctN1Sk1dDvJCtnUjxBcIxK5iK4sw== X-Google-Smtp-Source: AGHT+IG3G0wSHDDSZNWQ5FJ07xrTQOGMMXoTEqNJ7KCKTEj8gN0oI/34rjePfgYADQyTk+O2zCTPyg== X-Received: by 2002:a05:6a00:842:b0:704:1c78:4f8a with SMTP id d2e1a72fcca58-70eceda1dbemr1185756b3a.21.1722037645300; Fri, 26 Jul 2024 16:47:25 -0700 (PDT) Received: from [172.18.10.23] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7a9f884990asm3399456a12.54.2024.07.26.16.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jul 2024 16:47:24 -0700 (PDT) Message-ID: Subject: Re: MAINTAIN privilege -- what do we need to un-revert it? From: Jeff Davis To: Yugo Nagata , Noah Misch Cc: Michael Paquier , Nathan Bossart , pgsql-hackers@postgresql.org, Joe Conway , Robert Haas Date: Fri, 26 Jul 2024 16:47:23 -0700 In-Reply-To: <20240726122630.70e889f63a4d7e26f8549de8@sraoss.co.jp> References: <20240228165523.GA2435539@nathanxps13> <31ae1bf73e8a1dae3ee7ef2dd43a9bbda1e1ab86.camel@j-davis.com> <20240630222344.db.nmisch@google.com> <23fac3b2a722373a52b92a12ee0f500821450f97.camel@j-davis.com> <20240711125207.98.nmisch@google.com> <20240712231149.0d.nmisch@google.com> <8e0438821bddd4de198989e6ac0f9a2aa27cabeb.camel@j-davis.com> <20240713214748.cb@rfd.leadboat.com.sranhm> <20240726122630.70e889f63a4d7e26f8549de8@sraoss.co.jp> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, Thank you for looking. On Fri, 2024-07-26 at 12:26 +0900, Yugo Nagata wrote: > Since this commit, matviews are no longer handled in > ExecCreateTableAs, so the > following error message has not to consider materialized view cases, > and can be made simple. >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* SELECT should never rewrite= to more or less than one > SELECT query */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (list_length(rewritten) != =3D 1) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 elog(E= RROR, "unexpected rewrite result for %s", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 is_matview ? "CREATE MATERIALIZED VIEW" : > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 "CREATE TABLE AS SELECT"); There's a similar error in refresh_matview_datafill(), and I suppose that should account for the CREATE MATERIALIZED VIEW case. We could pass an additional flag to RefreshMatViewByOid to indicate whether it's a CREATE or REFRESH, but it's an internal error, so perhaps it's not important. > Another my question is why RefreshMatViewByOid has a ParamListInfo > parameter. I just passed the params through, but you're right, they aren't referenced at all. I looked at the history, and it appears to go all the way back to the function's introduction in commit 3bf3ab8c56. > I don't understand why ExecRefreshMatView has one, either, because > currently > materialized views may not be defined using bound parameters, which > is checked > in transformCreateTableAsStmt, and the param argument is not used at > all. It might > be unsafe to change the interface of ExecRefreshMatView since this is > public for a > long time, but I don't think the new interface RefreshMatViewByOid > has to have this > unused argument. Extensions should be prepared for reasonable changes in these kinds of functions between releases. Even if the signatures remain the same, the parse structures may change, which creates similar incompatibilities. So let's just get rid of the 'params' argument from both functions. Regards, Jeff Davis