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

Started by Klaus Hofeditz ]project-open[over 11 years ago4 messagesgeneral
Jump to latest
#1Klaus Hofeditz ]project-open[
klaus.hofeditz@project-open.com

<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi guys, <br>
I need to drop a view in order� to alter a type of a column:
numeric(12,1) -&gt;� numeric(12,2): <br>
<br>
ERROR:� cannot alter type of a column used by a view or rule
DETAIL:� rule _RETURN on view "TransTasksCube" depends on column
"billable_units"<br>
<br>
Trying to delete it, I get: <br>
<br>
projop=# drop view TransTasksCube;<br>
ERROR:� view "transtaskscube" does not exist<br>
<br>
FYI: VIEW also shows up in table INFORMATION_SCHEMA.views: <br>
<br>
projop=# select table_name from INFORMATION_SCHEMA.views where
table_name like '%Trans%';<br>
�� table_name<br>
----------------<br>
�TransTasksCube<br>
(1 row)<br>
<br>
Appreciate your help!<br>
Klaus <br>
<br>
<div class="moz-signature">-- <br>
<title></title>
<span style="font-size:8pt; font-family:'Verdana'; color:#666666;
text-decoration:none;">
Klaus Hofeditz<br>
Co-Founder ]project-open[<br>
<br>
<strong>Web:</strong> <a href="http://www.project-open.com&quot;&gt;http://www.project-open.com&lt;/a&gt;
<a href="http://www.project-open.org&quot;&gt;http://www.project-open.org&lt;/a&gt;&lt;br&gt;
<strong>LinkedIn:</strong> <a
href="http://www.linkedin.com/pub/klaus-hofeditz/2/604/871&quot;&gt;http://www.linkedin.com/pub/klaus-hofeditz/2/604/871&lt;/a&gt;&lt;br&gt;
<strong>XING:</strong> <a
href="https://www.xing.com/profile/Klaus_Hofeditz&quot;&gt;https://www.xing.com/profile/Klaus_Hofeditz&lt;/a&gt;&lt;br&gt;
<strong>Twitter:</strong> <a href="https://twitter.com/projop&quot;&gt;https://twitter.com/projop&lt;/a&gt;&lt;br&gt;
</span>
</div>
</body>
</html>

#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: Klaus Hofeditz ]project-open[ (#1)
Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"

Le 17 nov. 2014 22:49, "Klaus Hofeditz ]project-open[" <
klaus.hofeditz@project-open.com> a écrit :

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";

#3Klaus Hofeditz ]project-open[
klaus.hofeditz@project-open.com
In reply to: Guillaume Lelarge (#2)
Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Guillaume  splendid - tx! ./k<br>
<br>
On 17/11/2014 22:53, Guillaume Lelarge wrote:<br>
</div>
<blockquote
cite="mid:CAECtzeWLZ2tJDg=-Ax3Rj_LpAhtVaVaAbi1Gh+VCxVEAnu2KiA@mail.gmail.com"
type="cite">
<p dir="ltr">Le 17 nov. 2014 22:49, "Klaus Hofeditz
]project-open[" &lt;<a moz-do-not-send="true"
href="mailto:klaus.hofeditz@project-open.com">klaus.hofeditz@project-open.com</a>&gt;
a écrit :<br>
&gt;<br>
&gt; Hi guys, <br>
&gt; I need to drop a view in order  to alter a type of a
column: numeric(12,1) -&gt;  numeric(12,2): <br>
&gt;<br>
&gt; ERROR:  cannot alter type of a column used by a view or
rule DETAIL:  rule _RETURN on view "TransTasksCube" depends on
column "billable_units"<br>
&gt;<br>
&gt; Trying to delete it, I get: <br>
&gt;<br>
&gt; projop=# drop view TransTasksCube;<br>
&gt; ERROR:  view "transtaskscube" does not exist<br>
&gt;<br>
&gt; FYI: VIEW also shows up in table INFORMATION_SCHEMA.views:
<br>
&gt;<br>
&gt; projop=# select table_name from INFORMATION_SCHEMA.views
where table_name like '%Trans%';<br>
&gt;    table_name<br>
&gt; ----------------<br>
&gt;  TransTasksCube<br>
&gt; (1 row)</p>
<p dir="ltr">You need double quotes because of the upper case
letters:</p>
<p dir="ltr">drop view "TransTasksCube";</p>
</blockquote>
<br>
</body>
</html>

#4Thomas Kellerer
spam_eater@gmx.net
In reply to: Klaus Hofeditz ]project-open[ (#3)
Re: Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"

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.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general