pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedError "is not a table or materialized view" when creating a unique index on a materialized view on PostgreSQL 9.5.10
2+ messages / 1 participants
[nested] [flat]
* Error "is not a table or materialized view" when creating a unique index on a materialized view on PostgreSQL 9.5.10
@ 2020-02-06 09:03 Sterpu Victor <victor@caido.ro>
0 siblings, 1 reply; 2+ messages in thread
From: Sterpu Victor @ 2020-02-06 09:03 UTC (permalink / raw)
To: pgsql-admin
Hello
I have PostgreSQL 9.5.10 and when I receive the error: <table> is not a
table or materialized view when I try to create a unique index on a
materialized view.
These are the SQL commands:
CREATE MATERIALIZED VIEW public.focg_uni AS
SELECT f.nrfo,
to_char(min(fd.validfrom), 'YYYY'::text) AS anul_internarii
FROM focg f
JOIN focgdepartment fd ON fd.idfocg = f.id
GROUP BY f.nrfo
WITH DATA;
REFRESH MATERIALIZED VIEW public.focg_uni
CREATE UNIQUE INDEX focg_uni_check_index ON focg_uni_check(nrfo, an);
ERROR: "focg_uni_check" is not a table or materialized view
********** Error **********
ERROR: "focg_uni_check" is not a table or materialized view
SQL state: 42809
Thank you
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Error "is not a table or materialized view" when creating a unique index on a materialized view on PostgreSQL 9.5.10
@ 2020-02-06 09:05 Sterpu Victor <victor@caido.ro>
parent: Sterpu Victor <victor@caido.ro>
0 siblings, 0 replies; 2+ messages in thread
From: Sterpu Victor @ 2020-02-06 09:05 UTC (permalink / raw)
To: Sterpu Victor <victor@caido.ro>; pgsql-admin
I also tested these commands on a PostgreSQL 12.1 and the error is the
same.
------ Original Message ------
From: "Sterpu Victor" <victor@caido.ro>
To: pgsql-admin@postgresql.org
Sent: 2020-02-06 11:03:28 AM
Subject: Error "is not a table or materialized view" when creating a
unique index on a materialized view on PostgreSQL 9.5.10
>Hello
>
>I have PostgreSQL 9.5.10 and when I receive the error: <table> is not a
>table or materialized view when I try to create a unique index on a
>materialized view.
>
>These are the SQL commands:
>CREATE MATERIALIZED VIEW public.focg_uni AS
>SELECT f.nrfo,
> to_char(min(fd.validfrom), 'YYYY'::text) AS anul_internarii
> FROM focg f
> JOIN focgdepartment fd ON fd.idfocg = f.id
> GROUP BY f.nrfo
>WITH DATA;
>
>REFRESH MATERIALIZED VIEW public.focg_uni
>
>CREATE UNIQUE INDEX focg_uni_check_index ON focg_uni_check(nrfo, an);
>
>ERROR: "focg_uni_check" is not a table or materialized view
>********** Error **********
>
>ERROR: "focg_uni_check" is not a table or materialized view
>SQL state: 42809
>
>
>Thank you
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-02-06 09:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 09:03 Error "is not a table or materialized view" when creating a unique index on a materialized view on PostgreSQL 9.5.10 Sterpu Victor <victor@caido.ro>
2020-02-06 09:05 ` Sterpu Victor <victor@caido.ro>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox