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 1oHF8G-0006Dh-3h for pgsql-general@arkaria.postgresql.org; Fri, 29 Jul 2022 01:49:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oHF8E-0007oi-6X for pgsql-general@arkaria.postgresql.org; Fri, 29 Jul 2022 01:49:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHF8D-0007oY-Qm for pgsql-general@lists.postgresql.org; Fri, 29 Jul 2022 01:49:37 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oHF8B-0001Xg-DI for pgsql-general@lists.postgresql.org; Fri, 29 Jul 2022 01:49:36 +0000 Received: by mail-pl1-x62c.google.com with SMTP id x7so3310797pll.7 for ; Thu, 28 Jul 2022 18:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc; bh=8XTfvOCIr0cvOFe8nXtN83b1dJuzuMarSdGNG/WLcuY=; b=LkKcLMkI40qUzRJiPixmStoQjZuWtzFoIVoiF0AAdH7XHiS4L/APsD0QPJwfe5NHT0 pswAO6D3ULugBSZL8D1qG8ZTLpaZUzHHPjGrEZ0F5W92q7W4QOwOk13BBQbj+AFNtWyy Ah5OXcwKI7Vb4O1B1b4FJ4cDdGRt5WyNVyvTo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc; bh=8XTfvOCIr0cvOFe8nXtN83b1dJuzuMarSdGNG/WLcuY=; b=054hbmTb0ykhXN2LO6t2oGnCGri/Yzdw5KCgwVFtGhFcRT7BJwqmgfIBEzOmNLHNMr ZlC7YRsM2mIJVn8CsEPE90fRt+L/xMR6np3i6soPHGCWG7eXtrM/xnsDpqhUPkpC3lG2 MFO71qfpsrOriZKAj7pNDg4ULHE95WkSvc7c8mpMEIoyBQs4V0ZoNr6xhRS7ZHMUs9zb vbBXGijgbMpq2ydrD7tfwRb5x+aj4gY7mDNJogwmQ4gd+bzieZ0TCyn0I6OX0oPsyWr6 k0PLSEv3+xDqpk/WCkekuDugC/1vmI6EBzEaCnDfWRecj5Tx2BVIr1YLBXKcfooE0XgI JuYg== X-Gm-Message-State: ACgBeo3+zkcsuFQt7G5jX/5x+SNu8XCFQjnKTn2vpNfesn1SCWLMKUIz AvK09vSeoxN7bcnmQbJ3pwEZFxIYx3kqNw== X-Google-Smtp-Source: AA6agR5qDxv7WPj+DqfrQTCKkJT4wzaVLsTIPgVDwND/QJQvYPVeeI1iU48E09MPVd9Ysh+Alo3+cQ== X-Received: by 2002:a17:902:e791:b0:16d:7f5d:d29e with SMTP id cp17-20020a170902e79100b0016d7f5dd29emr1548026plb.14.1659059374273; Thu, 28 Jul 2022 18:49:34 -0700 (PDT) Received: from smtpclient.apple ([2601:646:101:7fda:e8a0:5e2b:7d85:3789]) by smtp.gmail.com with ESMTPSA id y6-20020a170902864600b0015e8d4eb1f7sm2021271plt.65.2022.07.28.18.49.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2022 18:49:33 -0700 (PDT) From: Bryn Llewellyn Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_7C927108-DF5F-457E-8D95-41F8C8FFAB1F" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: =?utf-8?Q?Re=3A_=C2=AB_The_PL/pgSQL_interpreter_parses_the_functi?= =?utf-8?Q?on=27s_source_text_and_produces_an_internal_binary_instruction_?= =?utf-8?Q?tree=2E=2E=2E_=C2=BB?= Date: Thu, 28 Jul 2022 18:49:32 -0700 In-Reply-To: <14BAC5B9-225E-49A8-A225-60C2F179E334@thebuild.com> Cc: pgsql-general list To: Christophe Pettus References: <14BAC5B9-225E-49A8-A225-60C2F179E334@thebuild.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_7C927108-DF5F-457E-8D95-41F8C8FFAB1F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > xof@thebuild.com wrote: >=20 >> bryn@yugabyte.com wrote: >>=20 >> Is this expected? >=20 > Yes. This isn't a bug=E2=80=A6 Database objects (such as tables and = columns) are left as identifiers until they are executed, because that = is the point at which a plan for those statements is created. The other = components of PL/pgSQL are translated to internal form (and thus checked = for existence) at compile time. My example was carefully contrived to test what you said=E2=80=94which = is what I had earlier understood. My deliberate typo thus: >> change "v_message" in "z :=3D v_message; return next;" to = "q_message" (surely) has nothing to do with possible database objects. The context = is a straight PL/pgSQL assignment statement (with no scalar subquery in = sight). It's this that surprises me. And it's this, and only this, that I'm = asking about: might _just_ this be a fixable bug?= --Apple-Mail=_7C927108-DF5F-457E-8D95-41F8C8FFAB1F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
xof@thebuild.com wrote:

bryn@yugabyte.com = wrote:

Is this = expected?

Yes.  This isn't a bug=E2=80=A6 Database objects (such = as tables and columns) are left as identifiers until they are executed, = because that is the point at which a plan for those statements is = created.  The other components of PL/pgSQL are translated to = internal form (and thus checked for existence) at compile = time.

My = example was carefully contrived to test what you said=E2=80=94which is = what I had earlier understood. My deliberate typo thus:

change "v_message" in "z :=3D v_message;  return next;" = to "q_message"

(surely) has nothing to do with = possible database objects. The context is a straight PL/pgSQL assignment = statement (with no scalar subquery in sight).

It's this that surprises me. And it's = this, and only this, that I'm asking about: might _just_ this be a = fixable bug?
= --Apple-Mail=_7C927108-DF5F-457E-8D95-41F8C8FFAB1F--