Re: Advice request : simultaneous function/data updates on many databases - Mailing list pgsql-general

From David G. Johnston
Subject Re: Advice request : simultaneous function/data updates on many databases
Date
Msg-id CAKFQuwZ8DCJu9BYckq3AocCP3rkX-g=VvDLON2qnisBnOgofxQ@mail.gmail.com
Whole thread Raw
In response to Re: Advice request : simultaneous function/data updates on manydatabases  (Rory Campbell-Lange <rory@campbell-lange.net>)
Responses Re: Advice request : simultaneous function/data updates on many databases  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Wed, Mar 4, 2020 at 3:48 PM Rory Campbell-Lange <rory@campbell-lange.net> wrote:
Any thoughts on how to wrap pl/pgsql function dropping and recreation code
within a wrapper pl/pgsql function?

Not endorsing this but dynamic SQL works just fine (though can get hard to read).  Use format() and EXECUTE ... USING liberally.

CREATE FUNCTION perform_update()...
AS $outer$
BEGIN

drop_sql := $inner$ DROP FUNCTION ...; $inner$
EXECUTE drop_sql;

END;
$outer$;

David J.

pgsql-general by date:

Previous
From: Rory Campbell-Lange
Date:
Subject: Re: Advice request : simultaneous function/data updates on manydatabases
Next
From: "David G. Johnston"
Date:
Subject: Re: Advice request : simultaneous function/data updates on many databases