BUG #5094: bad result in dblink_get_result when async command sending

Started by Sergey Tomoulevitchover 16 years ago2 messagesbugs
Jump to latest
#1Sergey Tomoulevitch
phoinix.public@gmail.com

The following bug has been logged online:

Bug reference: 5094
Logged by: Sergey Tomoulevitch
Email address: phoinix.public@gmail.com
PostgreSQL version: 8.4
Operating system: any
Description: bad result in dblink_get_result when async command
sending
Details:

Good day!

I find one bug in your function dblink_get_result.
When I send command in async query, eq:

SELECT dblink_send_query('remoteconn', 'INSERT INTO mytable (f1, f2) VALUES
(1,2);');

I can not get result for this, eq:

SELECT dblink_get_result('remoteconn');

I got error "ERRCODE_DATATYPE_MISMATCH".
May be...

if (PQnfields(res) != tupdesc->natts)...

is so bad, because PQnfields(res) - is empty for command?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sergey Tomoulevitch (#1)
Re: BUG #5094: bad result in dblink_get_result when async command sending

"Sergey Tomoulevitch" <phoinix.public@gmail.com> writes:

When I send command in async query, eq:

SELECT dblink_send_query('remoteconn', 'INSERT INTO mytable (f1, f2) VALUES
(1,2);');

I can not get result for this, eq:

SELECT dblink_get_result('remoteconn');

I got error "ERRCODE_DATATYPE_MISMATCH".

I'm not sure whether there is a code bug here, but the documentation for
dblink_get_result() says that you have to specify a result rowtype for
it. So you need something more like

SELECT * FROM dblink_get_result(''remoteconn') as t1(f1 text);

Does it work if you do that?

regards, tom lane