<table border="0" cellpadding="0" cellspacing="0"><tr><td style="font: inherit;" valign="top">Thanks a lot. I thought I
wouldgo with writing a function to Drop the views , ALTER table and the recreate the views so as to take care of the
columntype changes in the table.<br /><br />--- On <b>Tue, 5/5/09, Tom Lane <i><tgl@sss.pgh.pa.us></i></b>
wrote:<br/><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br
/>From:Tom Lane <tgl@sss.pgh.pa.us><br />Subject: Re: [HACKERS] ALTER TABLE should change respective views<br
/>To:"Peter Eisentraut" <peter_e@gmx.net><br />Cc: pgsql-hackers@postgresql.org, "Archana Sundararam"
<archnasr@yahoo.com><br/>Date: Tuesday, May 5, 2009, 8:10 AM<br /><br /><div class="plainMail">Peter Eisentraut
<<ahref="/mc/compose?to=peter_e@gmx.net" ymailto="mailto:peter_e@gmx.net">peter_e@gmx.net</a>> writes:<br />>
Andthis could then also change the return type of foo(), thus changing the <br />> row type of the view and would
thuspropogate up to other views. And so if <br />> you have "many views", as you say, this could become a great
mess. You could<br />> probably define and implement a solution, but it would be very confusing and <br />> risky
touse.<br /><br />The SQL committee has also historically chosen to punt on such things.<br />Note the long-established
rulethat "*" is expanded at view definition<br />time (so adding columns doesn't change views). I also see a flat<br
/>prohibitionon *any* view reference in the newly added SET DATA TYPE<br />command (SQL:2008 11.17 <alter column
datatype clause>):<br /><br />7) C shall not be referenced in the <query expression> of any view descriptor.
<br/><br /> regards, tom lane<br /></div></blockquote></td></tr></table><br />