Questions tagged [postgres-fdw]

Postgres foreign-data wrapper is a module which can be used to access data stored in external PostgreSQL servers.

144 questions
0
votes
1 answer

PostgreSQL CREATE SERVER with dynamic (non constant) options?

Using PostgreSQL 12 (or greater). Is there a way to use SQL, functions, or properties etc to fill in OPTIONS when creating a FDW server? I.e. I want to do something like: CREATE SERVER my_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS( dbname…
akagixxer
  • 1,767
  • 3
  • 21
  • 35
0
votes
1 answer

Create user mapping without password how to configure authentication

I am trying to create a user mapping in PostgreSQL without a password, but I am encountering an error that says. local_db=> select * from employee; ERROR: could not connect to server "testmachine02" DETAIL: connection to server at "192.168.56.10",…
Aymen Rahal
  • 115
  • 1
  • 10
0
votes
0 answers

POSTGRESQL - Insert into foreign table triggered insertion into another remote table

I have a problem to update records into my foreign table. It refers to a remote table which have a trigger to insert into another remote table (account_journals table). I recreated same trigger and adding another foreign table which refers to the…
0
votes
0 answers

How Can I Connect to a Remote SQL Server From a Local Postgres Database Using Postgres_fdw?

I've been working on a major project that compares data from multiple data sources. I've been using postgres_fdw for this and I've been successful in retrieving data to my local postgres instance from multiple remote postgres servers. My next step…
Andrew Stevenson
  • 578
  • 1
  • 9
  • 23
0
votes
1 answer

How to get postgres_fdw to push queries with small LIMITs to the foreign server?

I'm using postgres_fdw to connect to another PostgreSQL server. The foreign data wrapper is currently configured with a large fetch_size and extremely large fdw_startup_cost. This working well for most of my queries. I did this partly based on…
King Chung Huang
  • 5,026
  • 28
  • 24
0
votes
1 answer

How to combine data from postgreSQL and dynamic json in grafana

I have a grafana dashboard where I want to use an orcestra cities map dashboard to show status of some stations. The status is available as json from a http server (using nagios for this part) but the status has no idea of the location of the…
MortenSickel
  • 2,118
  • 4
  • 26
  • 44
0
votes
1 answer

Postrgres FDW vs multiple clients

Say I have two db1 and db2, with schema - db1.public.orders - db1.public.accounts - db2.public.orders - db2.public.accounts If I wish to have access to two databases, would it be recommended to import the whole schema using fdw into db1, so…
1qnew
  • 11
  • 3
0
votes
1 answer

postrgres_fdw doesn't send query WHERE clauses to the foreign db if has function parameters in the query

I want to make foreign db call in my custom function and put function input arguments into WHERE clause, but postgres does not send WHERE clause to foreign db and therefore does not use any indexes: There is the function: create or replace function…
0
votes
1 answer

How to keep foreign tables imported via foreign data wrapper in Postgres up to date with underlying table?

I am wondering how foreign data in Postgres are updated. I understand that the FDW makes a connection to the remote database to access the tables, and the foreign tables don't take up physical memory in the database. It is the equivalent of making a…
0
votes
2 answers

Postgres FDW Remote only JOIN causes fetch all data

I'm trying to fetch data from a remote server with JOIN clause which involves only remote tables, but it is very slow because the planner decides to fetch all data from two tables and merge it locally. When I add WHERE clause it fixes the problem…
rysi3k
  • 3
  • 2
0
votes
1 answer

Could not open extension control file POSTGRESQL

While trying to execute PostgreSQL extension in PostgreSQL 13 CREATE EXTENSION postgres_fdw; I am getting an error CREATE EXTENSION postgres_fdw "Could not open extension control file "/opt/pgsql13/share/extension/postgres_fdw.control": No such…
0
votes
0 answers

How to associate source files with dynamic library

I need to debug Postgres foreign data wrapper mysql_fdw.so. In Clion i try to attach postgres process. Debugger attached to process 8818 In source code of fdw i try to set break points, but it says no executable code associated with this line. How…
vantaqada
  • 101
  • 2
  • 6
0
votes
1 answer

Insert into foreign table partition doesn't work

I have some table in mariadb. I need to create foreign table partition for that table CREATE TABLE IF NOT EXISTS users ( id serial NOT NULL, name varchar(30) ) partition by range(id); CREATE foreign TABLE IF NOT EXISTS users_p partition…
0
votes
1 answer

Replace Oracle db with Postgres db , add an adapter

I have a source code querying an Oracle database. Is it possible to replace the Oracle database by a PostgreSQL database without modifying the source code ? I thought about adding an adapter/wrapper module between my source code and the PostgreSQL…
clouvis
  • 567
  • 1
  • 6
  • 18
0
votes
1 answer

Create foreign table on file_fdw as non-superuser

I have created a file_fdw extension and a corresponding server as superuser. CREATE EXTENSION file_fdw; CREATE SERVER myserver FOREIGN DATA WRAPPER file_fdw; ALTER SERVER myserver OWNER TO nonsuperuser; I want a non-superuser nonsuperuser to use…
Lokomotywa
  • 2,624
  • 8
  • 44
  • 73