pass non-formated query to PL function

From: Joao Miguel Ferreira <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: pass non-formated query to PL function
Date: 2021-04-02 09:34:42
Message-ID: CALyyT7QKVUVp-Z6k_g3MR9WVSssJQdKmvPGuEVPqg=F51b8RYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

Is it possible, in PL/pgSQL, to pass an argument to a function which is
actually a "query skeleton" that the method will "fill in the blanks" and
execute it or return it to the caller after ?

The caller does not have access to the variables/values that will be used
to fill the blanks, but it does know the generic query.

I have a situation where this kind of separation would be nice to have in
order to make the code a bit cleaner and avoid some code repetitions.

Thank you for you suggestions
Joao

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2021-04-02 09:42:12 Re: pass non-formated query to PL function
Previous Message Laurenz Albe 2021-04-02 08:40:00 Re: Primary keys and composite unique keys(basic question)