小编and*_*har的帖子

Create Materialized View from foreign table

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 …

postgresql materialized-view foreign-data postgresql-9.5

6
推荐指数
1
解决办法
2727
查看次数

在架构中的列条目上选择表(有很多表)

  • 我在 PostgreSQL-DB 中有一个架构,其中包含大约。3000 个表,每个表都有一行/条目(大小、id、geom)。我想选择大小值小于 20 的所有表。如何查询多个表而不加入它们?

  • 将所有这些表合并为一个并执行一个简单的 SELECT 查询会更好吗?

postgresql

5
推荐指数
1
解决办法
113
查看次数