select current_database() as current_db \gsetCREATE EXTENSION postgres_fdw;CREATE EXTENSIONCREATE EXTENSION dblink;CREATE EXTENSIONCREATE ROLE bob LOGIN PASSWORD 'bob';CREATE ROLECREATE SERVER bob_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( host 'localhost', dbname :'current_db' );CREATE SERVERCREATE USER MAPPING FOR public SERVER bob_srv OPTIONS ( user 'bob', password 'bob' );CREATE USER MAPPINGSELECT *FROM dblink('bob_srv','SELECT 1') as t(x integer); x --- 1(1 row)ALTER SERVER bob_srv OPTIONS (updatable 'true');ALTER SERVERSELECT *FROM dblink('bob_srv','SELECT 1') as t(x integer);psql:bug_example.sql:18: ERROR: could not establish connectionDETAIL: invalid connection option "updatable"
bug_example.sh:#!/bin/bashdropdb bug_exampledropuser bobcreatedb bug_examplepsql bug_example -f bug_example.sql
\set ECHO allselect current_database() as current_db \gsetCREATE EXTENSION postgres_fdw;CREATE EXTENSION dblink;CREATE ROLE bob LOGIN PASSWORD 'bob';CREATE SERVER bob_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( host 'localhost', dbname :'current_db' );CREATE USER MAPPING FOR public SERVER bob_srv OPTIONS ( user 'bob', password 'bob' );SELECT *FROM dblink('bob_srv','SELECT 1') as t(x integer);ALTER SERVER bob_srv OPTIONS (updatable 'true');SELECT *FROM dblink('bob_srv','SELECT 1') as t(x integer);
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных