postgres_fdw : disable extended queries

Started by Nicolas Parisover 9 years ago3 messagesgeneral
Jump to latest
#1Nicolas Paris
niparisco@gmail.com

Hello,

I have a 9.6 pg instance, and I am trying to link a foreign postgresql
database that do not accept extended queries. (only simple queries
https://www.postgresql.org/docs/current/static/protocol.html )

When I run a query against the foreign pg instance thought postres_fdw, it
looks like it sends a transaction containing

DECLARE c1 CURSOR FOR
SELECT customer_id FROM foodmart.customer

-> is there a way to run a simple query with postgres_fdw such:

SELECT customer_id FROM foodmart.customer

Thanks,

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Nicolas Paris (#1)
Re: postgres_fdw : disable extended queries

Nicolas Paris wrote:

I have a 9.6 pg instance, and I am trying to link a foreign postgresql database that do not accept
extended queries. (only simple queries https://www.postgresql.org/docs/current/static/protocol.html )

When I run a query against the foreign pg instance thought postres_fdw, it looks like it sends a
transaction containing

DECLARE c1 CURSOR FOR
SELECT customer_id FROM foodmart.customer

-> is there a way to run a simple query with postgres_fdw such:

SELECT customer_id FROM foodmart.customer

No, it is part of the design that cursors are used, so that rows can be
fetched one at a time and concurrent DML statements can be run.

You might consider using dblink.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Nicolas Paris
niparisco@gmail.com
In reply to: Laurenz Albe (#2)
Re: postgres_fdw : disable extended queries

2016-10-24 10:36 GMT+02:00 Albe Laurenz <laurenz.albe@wien.gv.at>:

Nicolas Paris wrote:

I have a 9.6 pg instance, and I am trying to link a foreign postgresql

database that do not accept

extended queries. (only simple queries https://www.postgresql.org/

docs/current/static/protocol.html )

When I run a query against the foreign pg instance thought postres_fdw,

it looks like it sends a

transaction containing

DECLARE c1 CURSOR FOR
SELECT customer_id FROM foodmart.customer

-> is there a way to run a simple query with postgres_fdw such:

SELECT customer_id FROM foodmart.customer

No, it is part of the design that cursors are used, so that rows can be
fetched one at a time and concurrent DML statements can be run.

​Actually problem is not with the cursor, sorry. Error message says it's
related to a prepared statement.
I am not able to debug it and see what is happening and what is the
prepared statement. ​

You might consider using dblink.


Dblink works great, but It seems less flexible (no predicate push down). I
am able to create a view that encapsulate dblink, but all the rows are
fetch each time I use the view.

Show quoted text

Yours,
Laurenz Albe