Re: function to operate on same fields, different records?

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: function to operate on same fields, different records?
Date: 2001-04-13 06:35:35
Message-ID: 20010413013535.A18960@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 02, 2001 at 02:02:51PM -0500, will trillich wrote:
> On Mon, Apr 02, 2001 at 10:21:34AM -0400, Tom Lane wrote:
> > Inheritance seems to work for this in current sources:
> >
> > regression=# create table p1 (f1 int);
> > CREATE
> > regression=# create table p2 (f2 int) inherits (p1);
> > CREATE
> > regression=# create function getf1(p1) returns int as '
> > regression'# select $1.f1' language 'sql';
> > CREATE
> > regression=# insert into p1 values(1);
> > INSERT 1030276 1
> > regression=# insert into p2 values(11,22);
> > INSERT 1030277 1
> > regression=# select getf1(p1) from p1;
> > getf1
> > -------
> > 1
> > 11
> > (2 rows)
>
> ding! light comes on ... never thought of that. mucho cool, mucho
> thanks! lots of new exploring to delve into now...

clunk, light dims. "current sources" means "not what i'm using".

being a staunch potato (debian 2.2) user, i'm already on the
leading edge, having upgraded my postgresql to 7.0.3 ...

i'll go with the

define function gpa(int,int,int,int,int) returns float ...

i suppose, then. hmph.

--
americans should never read anything so subversive as what's at
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pejac 2001-04-13 07:05:28 re : Address already in use?
Previous Message Yann Ramin 2001-04-13 03:33:06 Re: Address already in use?