Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8Xr4-0008DF-NT for pgsql-general@arkaria.postgresql.org; Mon, 25 Mar 2019 22:14:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8Xr1-0003Rx-FF for pgsql-general@arkaria.postgresql.org; Mon, 25 Mar 2019 22:14:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8Xr0-0003HB-2y for pgsql-general@lists.postgresql.org; Mon, 25 Mar 2019 22:14:03 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8Xqw-0005eD-DK for pgsql-general@lists.postgresql.org; Mon, 25 Mar 2019 22:14:00 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B0CED21711; Mon, 25 Mar 2019 18:13:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 25 Mar 2019 18:13:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=1 Yad2NKV1+WWhHuCvl2V4vwOBMCEwQb1d0EDHxzHd6o=; b=hOorRh9Cq2z/3WOYW 6DvZFbefihQOhLD/klOrr0TLheqwQ8kltK7bctMcpyytDrtAolKeaJm35oKq7Bkt Lurg85O/hKaA8EDsr39OKYxY+to49vd6iRCJoO6WWEMjMT+7gmvueCiPC4RHpflD yFOoksQ7FkDYMbzTg9CFqWH5/KSeCBYSaSGRyz6P3qBY5iPHZlPGir//9m/HSMCf q/0yGqbgTBkxNk4O14Li8aHPbRXFoudZWiFz8swFODyMU9i5FkzYRwZR/XKENRxQ ZnDjMk4ROWy4vqABDqR7Dg+JZcs6is5rm9mVPOokzWhGH1ivmi2z25O49j5wcSX1 F6Qxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=1Yad2NKV1+WWhHuCvl2V4vwOBMCEwQb1d0EDHxzHd 6o=; b=52yFg58oNyhrJSSIbAuZzrhsON8qU9/MXpcUMiRFcaBikYar4W84K2Uhc F3hQvqQ5N6XFmqOVKQKtKqTZjsq8VlkDUIKUuElGBe6o/OyuFvjDv/cBO4N+mK+L +FG2bIVLvMpiVE2RotlwLQQCt8unK0g86iON6pcHyJV7j2xPZSMpPQUVLqWNNfR5 voVtJBlAcAmfeeVwciaRButOtExwBhUWxoTEQ04ycWbjiEO+8YkOdRRGBaIUPNdZ bHgHQ1T/T+t7Jh3AZ2GcuuGjg4LblATSDQhdVoiByO4JBZNITJC8nbBJMhItfM2Q g6xpInL6yim+pGigxgypTU0f+81iw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrjeekgdduiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjeefrddvfeelrdduudejrddvfeeknecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsth gvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id CBCDC100E5; Mon, 25 Mar 2019 18:13:56 -0400 (EDT) Subject: Re: Error: "remote query result rowtype does not match the specified FROM clause rowtype," on remote function call To: Antonio Gomez , "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: <1a10f0e7-a098-65b7-c08a-440bfb871166@aklaver.com> Date: Mon, 25 Mar 2019 15:13:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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