How can I create a primary key on a materialized view in Postgres?
ALTER MATERIALIZED VIEW my_mat_view ADD PRIMARY KEY (id)
returns error:
Error in query: ERROR: "my_mat_view" is not a table
How can I create a primary key on a materialized view in Postgres?
ALTER MATERIALIZED VIEW my_mat_view ADD PRIMARY KEY (id)
returns error:
Error in query: ERROR: "my_mat_view" is not a table
Materialized views cannot have primary keys. You can use a unique index instead.
create unique index on my_mat_view (id)
© 2022 - 2024 — McMap. All rights reserved.