pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedAllow column type to change without worrying about view dependencies
2+ messages / 1 participants
[nested] [flat]
* Allow column type to change without worrying about view dependencies
@ 2009-05-22 14:55 Emi Lu <emilu@encs.concordia.ca>
0 siblings, 1 reply; 2+ messages in thread
From: Emi Lu @ 2009-05-22 14:55 UTC (permalink / raw)
To: pgsql-sql
Good morning,
When there are lots of views and complicated dependencies, it is not
easy to alter column from varchar(a) to varchar(b).
Is it possible when defining a view, adding cascade or some other key
word(s) to allow column type change?
When column1 is changed, all related views' column type is changed as well.
Thanks,
---
Lu Ying
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Allow column type to change without worrying about view dependencies
@ 2009-05-26 15:48 Emi Lu <emilu@encs.concordia.ca>
parent: Emi Lu <emilu@encs.concordia.ca>
0 siblings, 0 replies; 2+ messages in thread
From: Emi Lu @ 2009-05-26 15:48 UTC (permalink / raw)
To: ulka salvi <ulka3005@gmail.com>; pgsql-sql
ulka salvi wrote:
>>
>> u can try this
>> SELECT a,b,c,CAST(d AS float)
> AS N 'd',e,f,g INTO dbo.newtable
>
> Ulka
Did not follow.
Example,
create view v_test as select * from test1;
create table test(col1 varchar(12));
I'd like to:
alter table test alter column col1 type varchar(128);
Tried your suggested:
create or replace view v_test as select CAST( col1 as varchar(128)) from
test;
Got:
cannot change data type of view column "col1"
--
Lu Ying
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2009-05-26 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-05-22 14:55 Allow column type to change without worrying about view dependencies Emi Lu <emilu@encs.concordia.ca>
2009-05-26 15:48 ` Emi Lu <emilu@encs.concordia.ca>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox