From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Antonio Gomez <AGomez@EBSCO.COM>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Error: "remote query result rowtype does not match the specified FROM clause rowtype," on remote function call
Date: Mon, 25 Mar 2019 15:13:56 -0700
Message-ID: <1a10f0e7-a098-65b7-c08a-440bfb871166@aklaver.com> (raw)
In-Reply-To: <BN7PR01MB365172F60FCCC2F1DBEAB873D65E0@BN7PR01MB3651.prod.exchangelabs.com>
References: <BN7PR01MB365172F60FCCC2F1DBEAB873D65E0@BN7PR01MB3651.prod.exchangelabs.com>
On 3/25/19 1:08 PM, Antonio Gomez wrote:
> This is my *remote* function:
>
> CREATEORREPLACE FUNCTIONpublic._test1()
>
> RETURNS record
>
> LANGUAGE plpgsql
>
> AS$function$
>
> DECLARE
>
> rec record;
>
> BEGIN
>
> select1,2intorec;
>
> returnrec;
>
> END$function$;
>
> This is my *local* function call:
>
> SELECTx.a, x.b
>
> FROMdblink('conn_str', 'select public._test1();')
>
> asx(a int ,b int);
Do not have time to spin a test up at the moment, but what happens if
you do?"
SELECT *
FROM dblink('conn_str', 'select public._test1();')
as x(a int ,b int);
>
> This is the error thrown:
>
> ERROR: remote query result rowtype does notmatchthe specified FROMclause
> 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!
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, AGomez@EBSCO.COM
Subject: Re: Error: "remote query result rowtype does not match the specified FROM clause rowtype," on remote function call
In-Reply-To: <1a10f0e7-a098-65b7-c08a-440bfb871166@aklaver.com>
References: <BN7PR01MB365172F60FCCC2F1DBEAB873D65E0@BN7PR01MB3651.prod.exchangelabs.com> <1a10f0e7-a098-65b7-c08a-440bfb871166@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox