Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"
Date: 2014-11-17 22:16:26
Message-ID: m4ds3q$boq$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Klaus Hofeditz ]project-open[ wrote on 17.11.2014 23:10:
>> > Hi guys,
>> > I need to drop a view in order to alter a type of a column: numeric(12,1) -> numeric(12,2):
>> >
>> > ERROR: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view "TransTasksCube" depends on column "billable_units"
>> >
>> > Trying to delete it, I get:
>> >
>> > projop=# drop view TransTasksCube;
>> > ERROR: view "transtaskscube" does not exist
>> >
>> > FYI: VIEW also shows up in table INFORMATION_SCHEMA.views:
>> >
>> > projop=# select table_name from INFORMATION_SCHEMA.views where table_name like '%Trans%';
>> > table_name
>> > ----------------
>> > TransTasksCube
>> > (1 row)
>>
>> You need double quotes because of the upper case letters:
>>
>> drop view "TransTasksCube";
>>
>

> Hi Guillaume splendid - tx! ./k

Here is a detailed explanation on why you need this:

http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

But in general you should avoid quoted identifiers completely.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roger Pack 2014-11-17 23:03:37 Fwd: ability to return number of rows inserted into child partition tables request
Previous Message Klaus Hofeditz ]project-open[ 2014-11-17 22:10:35 Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"