Re: Composite datatypes, dynamic member fields

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Composite datatypes, dynamic member fields
Date: 2002-05-13 16:41:01
Message-ID: 20020513164101.GC9836@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 | 9
2001-12-15 | 2002-01-05 | 21
(2 rows)

Ross

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Denis CARTIER-MILLON 2002-05-13 16:53:23 libpq and borland c++ 5......
Previous Message C. Maj 2002-05-13 16:21:47 Re: PgAccess directory structure