Re: Table as argument in postgres function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Table as argument in postgres function
Date: 2019-05-21 07:13:46
Message-ID: CAFj8pRBW5KQF_5-581TesCvfY-+9K7sL+dfAH-ZKNc+HV4huuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

út 21. 5. 2019 v 9:04 odesílatel Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
napsal:

>
>>> Is there anything preventing us from having the planner resolve object
>>> names from strings?
>>>
>>
>> The basic problem is fact so when you use PREPARE, EXECUTE protocol, you
>> has not parameters in planning time.
>>
>
> I agree that it defeats PREPARE as it is currently implemented with
> PQprepare(), and it would never be meaningful to have a query plan that
> hasn't finalized which objects are involved.
>
> But could it be made to work with PQexecParams(), where the parameter
> values are already provided?
>
> Could we make a version of PQprepare() that takes an extra array of
> paramValues for object names that must be supplied at prepare-time?
>

I think so it is possible, but there is a question how much this design
uglify source code. Passing query parameters is maybe too complex already.

Second question. I am not sure if described feature is some different. ANSI
SQL 2016 knows Polymorphic table functions - looks like that. For me, I
would to see implementation of PTF instead increasing complexity of work
with parameters.

https://www.doag.org/formes/pubfiles/11270472/2019-SQL-Andrej_Pashchenko-Polymorphic_Table_Functions_in_18c_Einfuehrung_und_Beispiele-Praesentation.pdf

>
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matwey V. Kornilov 2019-05-21 07:22:48 Re: [PATCH v2] Introduce spgist quadtree @<(point,circle) operator
Previous Message Haribabu Kommi 2019-05-21 07:10:15 Re: PG 12 draft release notes

Browse pgsql-sql by date

  From Date Subject
Next Message Mohamed DIA 2019-05-23 09:49:52 Create function using quote_literal issues
Previous Message Corey Huinker 2019-05-21 07:04:07 Re: Table as argument in postgres function