and*_*har 6 postgresql materialized-view foreign-data postgresql-9.5
I'd like to create a simple materialized view from a table which lies in a different database. The two databases are on the same server.
What do I have to add to make the query access the foreign database and the table there?
CREATE MATERIALIZED VIEW mv_table_1 AS
SELECT *
FROM public.mv_table_1 --The schema & table from the different DB
WITH DATA;
Run Code Online (Sandbox Code Playgroud)
I tried using the fully qualified table name (db name before the schema name) but this results in an error:
References to other dbs are not implemented
默认情况下,PostgreSQL 数据库无法相互“看到”。这是一件好事。
您可以使用 postgres_fdw 外部数据包装器使一个 pg 数据库看到另一个 pg 数据库:https://www.postgresql.org/docs/current/static/postgres-fdw.html
脚步:
归档时间: |
|
查看次数: |
2727 次 |
最近记录: |