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 1txXOX-00AsbT-Hn for pgsql-general@arkaria.postgresql.org; Wed, 26 Mar 2025 20:30:37 +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 1txXOW-009ryG-5U for pgsql-general@arkaria.postgresql.org; Wed, 26 Mar 2025 20:30:36 +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 1txXOV-009ry8-Qq for pgsql-general@lists.postgresql.org; Wed, 26 Mar 2025 20:30:35 +0000 Received: from smtp102.iad3a.emailsrvr.com ([173.203.187.102]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1txXOU-001ItY-0G for pgsql-general@lists.postgresql.org; Wed, 26 Mar 2025 20:30:34 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp21.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 0B973257BB; Wed, 26 Mar 2025 16:30:32 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: Trying to dynamically create a procedure From: Christophe Pettus In-Reply-To: Date: Wed, 26 Mar 2025 13:30:02 -0700 Cc: "pgsql-general@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7BD4DF66-9D95-4B56-A91E-1BD08599B5D6@thebuild.com> References: To: "Dirschel, Steve" X-Mailer: Apple Mail (2.3776.700.51.11.1) X-Classification-ID: 1469a179-9780-4a7a-b892-fdd6da314cfa-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 26, 2025, at 13:27, Dirschel, Steve = wrote: >=20 > I think the problem has to do with having AS $$ and END $$ with the = 2 $=E2=80=99s. PostgreSQL's multiline-string syntax is quite flexible. You can do = things like: DO $doblock$ ... $doblock$ LANGUAGE plpgsql; I tend to put the name of the function between the $s to avoid nesting = problems.=