From: | "Luiz K(dot) Matsumura" <luiz(at)planit(dot)com(dot)br> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #3597: CREATE OR REPLACE VIEW |
Date: | 2007-09-04 18:09:16 |
Message-ID: | 46DD9F4C.1080802@planit.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Wow, I learn a lot about views now
Sorry for my confusion. You are right, my reasoning is very limited.
Thanks Heikki , Tom and Reece by yours answers.
Tom Lane wrote:
> "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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
>
--
Luiz K. Matsumura
Plan IT Tecnologia Informática Ltda.
From | Date | Subject | |
---|---|---|---|
Next Message | Luiz K. Matsumura | 2007-09-04 18:24:40 | Re: BUG #3598: Strange behaviour of character columns in select with views |
Previous Message | Reece Hart | 2007-09-04 17:33:27 | Re: BUG #3597: CREATE OR REPLACE VIEW |