Error: "remote query result rowtype does not match the specified FROM clause rowtype," on remote function call

From: Antonio Gomez <AGomez(at)EBSCO(dot)COM>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Error: "remote query result rowtype does not match the specified FROM clause rowtype," on remote function call
Date: 2019-03-25 20:08:18
Message-ID: BN7PR01MB365172F60FCCC2F1DBEAB873D65E0@BN7PR01MB3651.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is my remote function:
CREATE OR REPLACE FUNCTION public._test1()
RETURNS record
LANGUAGE plpgsql
AS $function$
DECLARE
rec record;
BEGIN
select 1,2 into rec;
return rec;
END $function$;

This is my local function call:
SELECT x.a, x.b
FROM dblink('conn_str', 'select public._test1();')
as x(a int ,b int);

This is the error thrown:
ERROR: remote query result rowtype does not match the specified FROM clause rowtype

Question:
Since DBLINK requires that I define a schema to place the function's return items, how do I make the call to recognize a record type being returned by the function.

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Cross 2019-03-25 21:11:24 Re: AW: Forks of pgadmin3?
Previous Message Brad Nicholson 2019-03-25 19:55:55 Re: [External] postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"