Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izd5o-0007aQ-6C for pgsql-admin@arkaria.postgresql.org; Thu, 06 Feb 2020 09:05:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izd4n-0007J9-I2 for pgsql-admin@arkaria.postgresql.org; Thu, 06 Feb 2020 09:03:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izd4m-0007J1-S6 for pgsql-admin@lists.postgresql.org; Thu, 06 Feb 2020 09:03:57 +0000 Received: from mail.caido.ro ([86.107.248.7]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izd4f-0008OO-HA for pgsql-admin@postgresql.org; Thu, 06 Feb 2020 09:03:55 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.caido.ro (Postfix) with ESMTP id 3C0951E9A7F for ; Thu, 6 Feb 2020 11:04:46 +0200 (EET) Received: from mail.caido.ro ([127.0.0.1]) by localhost (caido.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zeXX-5atHtnY for ; Thu, 6 Feb 2020 11:04:44 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by mail.caido.ro (Postfix) with ESMTP id C28101E9AE1 for ; Thu, 6 Feb 2020 11:04:44 +0200 (EET) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.caido.ro C28101E9AE1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=caido.ro; s=2B8A3026-9717-11E9-9D82-7DF1CDD8AB23; t=1580979884; bh=Ntwe23vUaxgQyThxBgdCxblieIzjPir3wP7//aSxtmk=; h=From:To:Subject:Date:Message-Id:Reply-To:Mime-Version: Content-Type; b=oleTg257ya/pBoE2hkD232zmAE62kpsw1MLBeqXFzIiJG43gVxGUqNjDdyQrJqFQl 4UlEFzm/NVUSoUGIURmp7WPjKHEIu5Vwp0dE9UnfaETvKb+hHjfC4O4HunD4Fwf9Dv mvqufeuQhWKMI7PzvCmnzb8LDydN/Xo2WTCoOmJg= X-Virus-Scanned: amavisd-new at caido.ro Received: from mail.caido.ro ([127.0.0.1]) by localhost (caido.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zZJE1RQpmKgI for ; Thu, 6 Feb 2020 11:04:44 +0200 (EET) Received: from [192.168.88.2] (unknown [89.43.152.14]) by mail.caido.ro (Postfix) with ESMTPSA id 85E291E9A7F for ; Thu, 6 Feb 2020 11:04:44 +0200 (EET) From: "Sterpu Victor" To: pgsql-admin@postgresql.org Subject: Error "is not a table or materialized view" when creating a unique index on a materialized view on PostgreSQL 9.5.10 Date: Thu, 06 Feb 2020 09:03:28 +0000 Message-Id: Reply-To: "Sterpu Victor" User-Agent: eM_Client/7.0.27943.0 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------=_MBF0B8F12D-4B31-4DAE-9397-CF98C4592942" X-Antivirus: Avast (VPS 200205-0, 02/05/2020), Outbound message X-Antivirus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --------=_MBF0B8F12D-4B31-4DAE-9397-CF98C4592942 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello I have PostgreSQL 9.5.10 and when I receive the error: is not a=20 table or materialized view when I try to create a unique index on a=20 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 =3D 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 --------=_MBF0B8F12D-4B31-4DAE-9397-CF98C4592942 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hello

I have PostgreSQL 9.5.10 and= when I receive the error: <table>=C2=A0is not a table or materialized view when I try to create a unique= index on a=C2=A0materialized view.=

= These are the SQL commands:
CREATE MATERIALIZED VIEW public.focg_uni AS
SELECT f.nrfo,
=C2=A0 =C2=A0to_char(min(fd.validfrom), 'YYYY'::text) AS anul_internarii=
=C2=A0 FROM focg f
=C2=A0 =C2=A0 JOIN focgdepartment fd ON = fd.idfocg =3D f.id
=C2=A0GROUP BY f.nrfo
WITH DATA;

REFRESH MATERIALIZED VIEW public.focg_uni

CREATE UNIQUE INDEX= focg_uni_check_index ON focg_uni_check(nrfo, an);

ER= ROR: =C2=A0"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
--------=_MBF0B8F12D-4B31-4DAE-9397-CF98C4592942--