Re: AW: Please advise features in 7.1

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>, "'John Huttley'" <John(at)mwk(dot)co(dot)nz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: AW: Please advise features in 7.1
Date: 2000-11-23 14:11:02
Message-ID: 3.0.1.32.20001123061102.0173e370@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 12:28 PM 11/23/00 +0100, Zeugswetter Andreas SB wrote:
>
>> Reason: I want to know if any of these features are scheduled.
>>
>> 1. Calculated fields in table definitions . eg.
>>
>> Create table test (
>> A Integer,
>> B integer,
>> the_sum As (A+B),
>> );
>
>This is currently easily done with a procedure that takes a tabletype
parameter
>with the name the_sum returning the sum of a + b.
>
> Create table test (
> A Integer,
> B integer
> );
>
>create function the_sum (test) returns integer as
>'
> begin;
> return ($1.a + $1.b);
> end;
>' language 'plpgsql';
>
>A select * won't return the_sum

create view test2 select A, B, A+B as the_sum from test;

will, though.

See, lots of ways to do it!

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-11-23 15:30:44 Re: Please advise features in 7.1
Previous Message Don Baccus 2000-11-23 14:07:35 Re: Please advise features in 7.1