Re: dblink: add polymorphic functions. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: dblink: add polymorphic functions.
Date
Msg-id 21220.1438203543@sss.pgh.pa.us
Whole thread Raw
In response to Re: dblink: add polymorphic functions.  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: dblink: add polymorphic functions.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> On Wed, Jul 29, 2015 at 12:53 PM, Joe Conway <mail@joeconway.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



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: more RLS oversights
Next
From: Robert Haas
Date:
Subject: Re: more RLS oversights