From: | Peter Hunsberger <peter(dot)hunsberger(at)gmail(dot)com> |
---|---|
To: | Thom Brown <thombrown(at)gmail(dot)com> |
Cc: | Chris Barnes <compuguruchrisbarnes(at)hotmail(dot)com>, sim(at)compulab(dot)co(dot)il, Postgres General Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: alter table alter type CASCADE |
Date: | 2010-05-06 02:57:36 |
Message-ID: | z2hcc159a4a1005051957k297cf579r7ebb2522f3c49bee@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, May 5, 2010 at 7:31 AM, Thom Brown <thombrown(at)gmail(dot)com> wrote:
> On 5 May 2010 13:14, Chris Barnes <compuguruchrisbarnes(at)hotmail(dot)com> wrote:
>>
>> It has been some years since I worked with Oracle, doesn't Oracle
>> recompile the view when the object it references changes in structure?
>> Send
>
> What does Oracle do when you've got a view like:
>
> CREATE OR REPLACE VIEW test_view AS
> SELECT test.test_id, test.test_value, date_is_future(test.test_date) as
> upcoming
> FROM test;
>
> Where date_is_future expects a text field, but you change the test table so
> that test_date is now varchar(20)? The function no longer matches the
> signature. Does it just prevent it? And what about when conditions are
> provided in a WHERE clause which become invalid when the column type
> changes?
>
If Oracle can find a function that will make the view valid it will
continue to allow usage of the view; though it is still marked as
needing to be rebuilt from a user perspective any calls to it will
succeed if there is a possible way for the view to still be valid. If
there is no possible way for any use of the view to succeed then the
calls fail.
--
Peter Hunsberger
From | Date | Subject | |
---|---|---|---|
Next Message | Konstantin Izmailov | 2010-05-06 03:47:42 | Re: Savepoint and prepared transactions |
Previous Message | Alvaro Herrera | 2010-05-05 22:16:23 | Re: pg_class has 3615 rows and 1010Mb in table size |