Re: Trying to dynamically create a procedure

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: "Dirschel, Steve" <steve(dot)dirschel(at)thomsonreuters(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Trying to dynamically create a procedure
Date: 2025-03-26 20:30:02
Message-ID: 7BD4DF66-9D95-4B56-A91E-1BD08599B5D6@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Mar 26, 2025, at 13:27, Dirschel, Steve <steve(dot)dirschel(at)thomsonreuters(dot)com> wrote:
>
> I think the problem has to do with having AS $$ and END $$ with the 2 $’s.

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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-03-26 20:36:55 Re: Q on SELECT column list pushdown from view to table
Previous Message Dirschel, Steve 2025-03-26 20:27:29 Trying to dynamically create a procedure