Re: dblink: add polymorphic functions.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: dblink: add polymorphic functions.
Date: 2015-07-29 20:59:03
Message-ID: 21220.1438203543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> On Wed, Jul 29, 2015 at 12:53 PM, Joe Conway <mail(at)joeconway(dot)com> wrote:
>> Ok, gotcha. So Tom's nearby comment about allowing the
>> "p_rowtype%TYPE" syntax to be used in the CAST is spot on (as usual).
>> In other words, to get a complete solution for you we would need to
>> make both things work, so you could do this inside plpgsql:

>> select * from cast(dblink(connstr, sql) as p_rowtype%TYPE);

> Would this be a pl/pgsql only solution?

Well, it would depend on how we fixed %TYPE, but my thought is that
we should teach the core parser to accept variable%TYPE anywhere that
a suitable "variable" is in scope. The core already allows related
syntaxes in some utility commands, but not within DML commands.

(I am not sure offhand if the existing core syntax is exactly compatible
with what plpgsql does, though; and that could be a problem.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-07-29 20:59:52 Re: more RLS oversights
Previous Message Joe Conway 2015-07-29 20:57:21 Re: more RLS oversights