Search Postgresql Archives

Re: dblink_get_result issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/10/2010 03:54 PM, Tom Lane wrote:
> "Marc Mamin" <M.Mamin@xxxxxxxxxxxx> writes:
> 
>> SELECT * FROM dblink_get_result('myconn1', true ) as x (t text);
> 
>> => 
>> ********** Error **********
>> remote query result rowtype does not match the specified FROM clause
>> rowtype

> Hmm.  I can reproduce this in 8.4 too, but it seems OK in 9.0.  The only
> one of the 9.0 commits that seems likely to be relevant is
> http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=56cbb611ec749ba867a4cfc09c8b7df0f4446620
> which looks a bit overcomplex for a back-patch.  Joe, any thoughts?

Sorry for the slow response.

I think this issue was fixed by that patch only as a side effect of
significant restructuring. The attached one liner against 8.4 seems to
fix it. Objections?

Joe

-- 
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 72e80f2..0d21cc0 100644
*** a/contrib/dblink/dblink.c
--- b/contrib/dblink/dblink.c
*************** dblink_record_internal(FunctionCallInfo 
*** 920,926 ****
  		/*
  		 * check result and tuple descriptor have the same number of columns
  		 */
! 		if (PQnfields(res) != tupdesc->natts)
  			ereport(ERROR,
  					(errcode(ERRCODE_DATATYPE_MISMATCH),
  					 errmsg("remote query result rowtype does not match "
--- 920,926 ----
  		/*
  		 * check result and tuple descriptor have the same number of columns
  		 */
! 		if (!is_sql_cmd && PQnfields(res) != tupdesc->natts)
  			ereport(ERROR,
  					(errcode(ERRCODE_DATATYPE_MISMATCH),
  					 errmsg("remote query result rowtype does not match "

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux