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 1izdIn-0007wo-Cf for pgsql-admin@arkaria.postgresql.org; Thu, 06 Feb 2020 09:18:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izdIm-0007dk-1Z for pgsql-admin@arkaria.postgresql.org; Thu, 06 Feb 2020 09:18:24 +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 1izdIl-0007cr-FZ for pgsql-admin@lists.postgresql.org; Thu, 06 Feb 2020 09:18:23 +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 1izdIh-0008V2-KB for pgsql-admin@postgresql.org; Thu, 06 Feb 2020 09:18:22 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.caido.ro (Postfix) with ESMTP id 2740D1E9A7F; Thu, 6 Feb 2020 11:19:17 +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 m7GJgNIuv3Af; Thu, 6 Feb 2020 11:19:16 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by mail.caido.ro (Postfix) with ESMTP id 503361E9AE1; Thu, 6 Feb 2020 11:19:16 +0200 (EET) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.caido.ro 503361E9AE1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=caido.ro; s=2B8A3026-9717-11E9-9D82-7DF1CDD8AB23; t=1580980756; bh=ToPJiAbsQorBfnGmaqMQbhLkqcqgY2nFCQMSriP2p9o=; h=From:To:Subject:Date:Message-Id:Reply-To:Mime-Version: Content-Type; b=i/yeMdTLhJsgiFqSqkHss9jKczG8FlUbI5+VHkz4oPYNet0gv2r5PQcZ0YD28DnJA yBGdh6aiYniP5HoIofml69nCxIFK6jASU12yJaY23Od046drcI1dPplPohvWOABRaz I/PA3T1cVtIZ4MLA83OSlsRBk54jlfRCeG/lro1M= 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 5WDBDrWnAb6w; Thu, 6 Feb 2020 11:19:16 +0200 (EET) Received: from [192.168.88.2] (unknown [89.43.152.14]) by mail.caido.ro (Postfix) with ESMTPSA id 13F2F1E9A7F; Thu, 6 Feb 2020 11:19:16 +0200 (EET) From: "Sterpu Victor" To: "Pallavi Kumari" , pgsql-admin@postgresql.org Subject: Re[2]: 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:18:09 +0000 Message-Id: In-Reply-To: References: Reply-To: "Sterpu Victor" User-Agent: eM_Client/7.0.27943.0 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------=_MBF7AAADAD-70DC-4258-B18B-18EB5655AFAC" 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 --------=_MBF7AAADAD-70DC-4258-B18B-18EB5655AFAC Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you... :)) ------ Original Message ------ From: "Pallavi Kumari" To: "Sterpu Victor" Sent: 2020-02-06 11:09:43 AM Subject: Re: Error "is not a table or materialized view" when creating a= =20 unique index on a materialized view on PostgreSQL 9.5.10 >hi, >in creating unique index you are getting error because u mentioned=20 >wrong view name(focg_uni_check). >it should be focg_uni not focg_uni_check. >current syntax: >>CREATE UNIQUE INDEX focg_uni_check_index ON focg_uni(nrfo, an); > > >On Thu, Feb 6, 2020 at 2:35 PM Sterpu Victor wrote: >>I also tested these commands on a PostgreSQL 12.1 and the error is the= =20 >>same. >> >>------ Original Message ------ >>From: "Sterpu Victor" >>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=20 >>unique index on a materialized view on PostgreSQL 9.5.10 >> >>>Hello >>> >>>I have PostgreSQL 9.5.10 and when I receive the error: is not= =20 >>>a 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 --------=_MBF7AAADAD-70DC-4258-B18B-18EB5655AFAC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
=
Thank you... =C2=A0:))
------ Original Message ------
From: "Pallavi Kumari" <pallavisingh33.ps76@gmail.com>
To: "Sterpu Victor" <victor@caid= o.ro>
Sent: 2020-02-06 11:09:43 AM
Subject: Re: Error "is not a table or materialized view" when creating= a unique index on a materialized view on PostgreSQL 9.5.10
hi,
in creating unique index you are getting error = because u mentioned=C2=A0wrong view name(focg_uni_check).
it shou= ld be focg_uni not=C2=A0focg_uni_check.
current=C2=A0syntax:
CREATE UNIQUE INDEX focg_uni_ch= eck_index ON focg_uni(nrfo, an);

<= /div>
On Thu, Feb 6, 2020 at 2:35 PM Sterpu Victor <victor@caido.ro> wrote:
I also tested these commands on a PostgreSQL 12.1 and the error= is the same.

------ Original Message ------
From: "Sterpu Victor" <victor@ca= ido.ro>
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>=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

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

ERROR: =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
--------=_MBF7AAADAD-70DC-4258-B18B-18EB5655AFAC--