Re: dblink_get_result issue

From: "Marc Mamin" <M(dot)Mamin(at)intershop(dot)de>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>, "Joe Conway" <mail(at)joeconway(dot)com>
Subject: Re: dblink_get_result issue
Date: 2010-11-11 08:48:38
Message-ID: C4DAC901169B624F933534A26ED7DF31034BB8CB@JENMAIL01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

For now I just ignore the first exception.

BEGIN
PERFORM * from dblink_get_result('myconn')as x (t text);
EXCEPTION WHEN datatype_mismatch THEN NULL;
END;
PERFORM * from dblink_get_result('myconn')as x (t text);

thanks,

Marc Mamin

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Donnerstag, 11. November 2010 00:54
To: Marc Mamin
Cc: pgsql-general(at)postgresql(dot)org; Joe Conway
Subject: Re: [GENERAL] dblink_get_result issue

"Marc Mamin" <M(dot)Mamin(at)intershop(dot)de> writes:
> I'm experimenting with dblink, and have an issue with async. queries
> that do not return result sets.

> (Postgres 8.3.9)

> --youll need your own connect string to repeat:

> select dblink_connect_u('myconn1', 'hostaddr=127.0.0.1 port=5432
> dbname=postgres user=postgres password=x');

> select dblink_send_query('myconn1', 'create temp table bah(s
int8);');
> select pg_sleep(.3);

> 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=56cbb61
1ec749ba867a4cfc09c8b7df0f4446620

which looks a bit overcomplex for a back-patch. Joe, any thoughts?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marc Mamin 2010-11-11 08:55:05 Re: Considering Solid State Drives
Previous Message Marc Mamin 2010-11-11 08:33:41 Re: REINDEX requirement?