pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sterpu Victor <victor@caido.ro>
To: Pallavi Kumari <pallavisingh33.ps76@gmail.com>
To: 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: <em8b5f985a-54d8-4009-9b6f-9c3cc0f319d0@victor-pc> (raw)
In-Reply-To: <CAJ1u=+Oh42=VDwNLckYab-SdLAgQaSHu7+Tk3pk3-pjA=bsRXw@mail.gmail.com>
References: <em2fa190be-aa30-4ab6-9228-10879ac31b8b@victor-pc>
	<em49ea750c-976c-4dcf-a902-069df8ce82aa@victor-pc>
	<CAJ1u=+Oh42=VDwNLckYab-SdLAgQaSHu7+Tk3pk3-pjA=bsRXw@mail.gmail.com>

Thank you...  :))

------ Original Message ------
From: "Pallavi Kumari" <pallavisingh33.ps76@gmail.com>
To: "Sterpu Victor" <victor@caido.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 
>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 <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@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

Message-ID: <em8b5f985a-54d8-4009-9b6f-9c3cc0f319d0@victor-pc>
Permalink:  ../em8b5f985a-54d8-4009-9b6f-9c3cc0f319d0@victor-pc/
Also on:    postgresql.org/message-id/em8b5f985a-54d8-4009-9b6f-9c3cc0f319d0@victor-pc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: victor@caido.ro, pallavisingh33.ps76@gmail.com
  Subject: Re: Error "is not a table or materialized view" when creating a unique index on a materialized view on PostgreSQL 9.5.10
  In-Reply-To: <em8b5f985a-54d8-4009-9b6f-9c3cc0f319d0@victor-pc>
  References: <em2fa190be-aa30-4ab6-9228-10879ac31b8b@victor-pc> <em49ea750c-976c-4dcf-a902-069df8ce82aa@victor-pc> <CAJ1u=+Oh42=VDwNLckYab-SdLAgQaSHu7+Tk3pk3-pjA=bsRXw@mail.gmail.com> <em8b5f985a-54d8-4009-9b6f-9c3cc0f319d0@victor-pc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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