Re: Trying to dynamically create a procedure

2025-04-05 Thread Laurenz Albe
On Wed, 2025-03-26 at 20:27 +, Dirschel, Steve wrote: > DO $$ >   > BEGIN >   > EXECUTE 'create or replace procedure junk.test_proc() ' || >   'LANGUAGE plpgsql  '  || >   'AS $$ '    || >   'declare  '  || >   '  v_cnt

Re: Trying to dynamically create a procedure

2025-03-26 Thread Christophe Pettus
> On Mar 26, 2025, at 13:27, Dirschel, Steve > 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 th