Re: [SQL] Defining Field Types with view

2004-09-01 Thread Tom Lane
"Traci Sumpter" <[EMAIL PROTECTED]> writes: > Cheesy one here Got a cheesy answer for you --- cast the result ... regression=# create view voo as regression-# select f1::varchar(20) from regression-# (select f1 from foo union select f2 from foo) ss; CREATE VIEW regression=# \d voo

[SQL] Defining Field Types with view

2004-09-01 Thread Traci Sumpter
Cheesy one here I created a view similar to Select field1, field2 from table where field3 = 'Fred' UNION Select field1, field2 from table where field3 = 'Wilma'; When the view contains just one sql statement the field definitions e.g. charater varying (20) however when both a