Re: Localizing stored functions by replacing placeholders in their body

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Localizing stored functions by replacing placeholders in their body
Date: 2021-03-03 08:08:29
Message-ID: CAADeyWhoP_3KcEZkDmfOX+wrkCzG-8ZunvZNpgGFvzAxGQv-iQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for your input

Actually, yes, that is what I have right now a translate() like stored
function, with format %s sometimes.

But that is "at runtime" and I would like to have a "at compile
time"/"deploy once and forget" solution, that is why I have asked about
approaches for modifying the bodys of my stored functions.

After some more thinking yesterday I have decided to embed the SQL files
with stored functions declarations in my servlet JAR file - that is where
the rest and most of my translations are.

I will just load them from servlet resources when the servlet start,
replace the placeholder by Java and the execute them with CREATE OR REPLACE
FUNCTION ...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tobias Lott 2021-03-03 08:58:33 permission denied for pg_temp_XX when vacuuming
Previous Message Kevin Brannen 2021-03-02 23:57:09 RE: Localizing stored functions by replacing placeholders in their body