Can't drop a view ("view does not exist") that has an entry in "INFORMATION_SCHEMA.views"
<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) ->� 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">http://www.project-open.com</a>
<a href="http://www.project-open.org">http://www.project-open.org</a><br>
<strong>LinkedIn:</strong> <a
href="http://www.linkedin.com/pub/klaus-hofeditz/2/604/871">http://www.linkedin.com/pub/klaus-hofeditz/2/604/871</a><br>
<strong>XING:</strong> <a
href="https://www.xing.com/profile/Klaus_Hofeditz">https://www.xing.com/profile/Klaus_Hofeditz</a><br>
<strong>Twitter:</strong> <a href="https://twitter.com/projop">https://twitter.com/projop</a><br>
</span>
</div>
</body>
</html>
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 existFYI: 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";
<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[" <<a moz-do-not-send="true"
href="mailto:klaus.hofeditz@project-open.com">klaus.hofeditz@project-open.com</a>>
a écrit :<br>
><br>
> Hi guys, <br>
> I need to drop a view in order to alter a type of a
column: numeric(12,1) -> 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)</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>
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 existFYI: 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