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-DB 中有一个架构,其中包含大约。3000 个表,每个表都有一行/条目(大小、id、geom)。我想选择大小值小于 20 的所有表。如何查询多个表而不加入它们?
将所有这些表合并为一个并执行一个简单的 SELECT 查询会更好吗?