Re: Composite datatypes, dynamic member fields - Mailing list pgsql-interfaces

From Ross J. Reedstrom
Subject Re: Composite datatypes, dynamic member fields
Date
Msg-id 20020513164101.GC9836@rice.edu
Whole thread Raw
In response to Re: Composite datatypes, dynamic member fields  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
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 |       92001-12-15 | 2002-01-05 |      21
(2 rows)


Ross


pgsql-interfaces by date:

Previous
From: "C. Maj"
Date:
Subject: Re: PgAccess directory structure
Next
From: "C. Maj"
Date:
Subject: Re: pgaccess - the discussion is over