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
3
votes
1 answer

How to set up permissions on foreign table using postgres_fdw?

The source data is in a keys table in the public schema of database keys (reference pg docs: https://www.postgresql.org/docs/current/postgres-fdw.html) : create table keys ( id varchar not null, keyname varchar not null, created…
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
3
votes
1 answer

Query tables from multiple servers with postgreSQL

I have several databases on the different PostgreSQL servers with the tables with the same columns in it (installs_1, installs_2 and installs_3) installs(country varchar, date datetime,paid boolean, installs int) I want to write a function that a…
anna
  • 51
  • 8
3
votes
1 answer

PostgreSQL postgres_fdw querying very slowly on large foreign table when using CURRENT_DATE - 1 but not with hardcoded date

I am using postgres_fdw to connect to another PostgreSQL DB. Sometimes the performance of a query works fine, but other times a query can take an abnormally long time. I have run into an issue where if I use the function CURRENT_DATE, the query…
3
votes
2 answers

Django model reference to a postgres foreign table (clickhouse_fdw)

I have a Django project. I've connected a clickhouse table with a postgres table using clickhouse_fdw. Following clickhouse_fdw instructions, in postgres I did: CREATE EXTENSION clickhousedb_fdw; CREATE SERVER clickhouse_svr FOREIGN DATA WRAPPER…
3
votes
1 answer

PostgreSQL Foreign Table Error Relation Doesn't Exist

I've created a foreign table urltrackerft In my foreign server util it has table urltracker: I've followed the steps in creating the foreign server and table here: https://www.postgresql.org/docs/current/postgres-fdw.html My create script looks…
sojim2
  • 1,245
  • 2
  • 15
  • 38
3
votes
0 answers

Why does INSERT INTO [local table] SELECT … FROM [foreign data wrapper table] hang when using psycopg2?

Setup A PostgreSQL 10.6 database set up using Django Rest Framework (DRF) which will eventually take over from the legacy system. Contains hundreds of millions of rows. A single PostgreSQL 10.6 remote instance with a legacy schema. Task Import the…
l0b0
  • 55,365
  • 30
  • 138
  • 223
3
votes
0 answers

Linking Access tables into a PostgreSQL Database using a foreign data wrapper

I'm new to postgres so this problem is probably a relatively easy one for someone else. However, I have spent many frustrating hours trying to figure out the solution. I have an Access Database of metadata that must be kept updated for sending…
3
votes
1 answer

Error translating host name when creating a foreign table with postgres_fdw

EDIT: I've resolved the issue. Spoiler, it has nothing to do with psql or fdw. It was a DNS issue because I am running my local DB in a docker machine that was not configured with our internal DNS server. I am trying to create a foreign table (from…
medley56
  • 1,181
  • 1
  • 14
  • 29
3
votes
0 answers

PIpelineDB continuous view with mysql foreign data wrapper

I am getting different results when I complete a stream join on a foreign table vs when I join a continuous view to a foreign table. Two queries that I would expect to be the same appear to be different. Does the delay between my local pipeline…
bvk
  • 31
  • 3
2
votes
1 answer

Postgres query of a partitioned table pointing to foreign data workers many times slower than querying fdw directly

Thanks in advance to anyone who might be able to help with this. I have a Postgres 15.2 database which uses a partition table to access foreign data worker tables by a Zone id. Each zone further breaks down data by period in each zone database. The…
coduspocus
  • 23
  • 3
2
votes
1 answer

How to create an (FDW) foreign table and map it to a different schema?

This is how I defined the foreign table: CREATE FOREIGN TABLE ftbl_employee ( id UUID, name VARCHAR, ) SERVER company_registry_dbserver OPTIONS (schema_name 'company', table_name 'company_employee'); It created the foreign table…
Shift 'n Tab
  • 8,808
  • 12
  • 73
  • 117
2
votes
1 answer

FDW with an IAM DB Auth user

I have a user with role rds_iam so IAM DB Auth is required for the user to connect to my Aurora PostgreSQL server (server A). Which works as expected. I have added a role to Server B that has permissions to rds-db:connect to server A. Now I need to…
kravb
  • 417
  • 4
  • 16
2
votes
0 answers

PostgreSQL FDW on S3 object storage

I am having one requirement for SQL-like interface to query S3 object storage(It's not actually AWS S3, but S3 based protocol storage. We are having server name, bucket name, access_key and secret_access_key available with us). I need to know…
2
votes
1 answer

PostgreSQL fdw table performance drops exponentially after exactly 5 identical queries

I have a postgres 13.3 database running on a CentOS machine. Nothing else is running on this machine as these tests are being performed, and nothing else accesses the database while tests are performed. The table jammerdal contains about 500.000…
2
votes
0 answers

Slow insert in Postgresql when sharding using declarative partitioning and postgres_fdw?

We have been trying to partition postgresql database on google cloud using the inbuilt Postgresql declarative partitioning and postgres_fdw as explained here. We are running commands as follow: Shard 1: CREATE TABLE message_1 ( id SERIAL, …
1
2
3
9 10