Skip site navigation (1) Skip section navigation (2)

Re: BUG #3597: CREATE OR REPLACE VIEW

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "Luiz K(dot) Matsumura" <luiz(at)planit(dot)com(dot)br>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3597: CREATE OR REPLACE VIEW
Date: 2007-09-04 15:18:40
Message-ID: 25302.1188919120@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> writes:
> Luiz K. Matsumura wrote:
>> But, with  the 'replace' command, this isn't implicit ?
>> If they found a view, replace the existing view with the new one (on the
>> other words, drop and create again?)

> Replacing is not exactly the same thing as dropping and recreating it.
> If the view has dependencies, you can't drop it without dropping the
> dependent objects first, and likewise you can't change its datatypes
> because it would affect the dependent objects as well (hence the
> limitation on CREATE OR REPLACE VIEW).

Right.  And the reason this appears to be a data type change is that
"NULL" is not length-constrained, so the type computed for the first
UNION's output is just bpchar (ie, unconstrained-length character)
rather than character(3) which is what you get in the second case.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-09-04 15:47:20
Subject: Re: BUG #3598: Strange behaviour of character columns in select with views
Previous:From: Alexis BeuraudDate: 2007-09-04 10:21:19
Subject: BUG #3599: Wrong search_path inside a function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group