On Mon, May 13, 2002 at 10:17:55AM -0400, Tom Lane wrote:
>
> The computed field doesn't quite have the same status as real fields
> --- notice that * doesn't know about it in the above example --- but
> it's a useful technique anyway.
That particular shortcoming can be overcome by wrapping the computed
fields in a view:
create view tour_lengths AS select *, tours.numdays from tours;
test=# create view tours_plus as select *, tours.numdays from tours;
CREATE
test=# select * from tours_plus;
depart | return | numdays
------------+------------+---------
2002-01-01 | 2002-01-10 | 9
2001-12-15 | 2002-01-05 | 21
(2 rows)
Ross