R: multiple paramters in aggregate function

From: Scara Maccai <m_lists(at)yahoo(dot)it>
To: pgsql-general(at)postgresql(dot)org, Sim Zacks <sim(at)compulab(dot)co(dot)il>
Subject: R: multiple paramters in aggregate function
Date: 2009-08-13 11:07:13
Message-ID: 258695.23223.qm@web24612.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is there a better way?

I think you could use a User Data Type.
Then pass that as parameter to your aggregate function.

That is: you would pass

(4, 'meter')

(400, 'mm')

(100, 'cm')

to your aggregate function.

Each one is a user datatype:

CREATE TYPE mytype AS (
v double precision,
t varchar(10)
);

See

http://www.postgresql.org/docs/8.4/static/rowtypes.html

This is the example based on a custom data type of complex numbers:

http://www.postgresql.org/docs/8.4/static/xaggr.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PG Subscriber 2009-08-13 11:21:27 difficulty running pg on XP as appl.
Previous Message Scara Maccai 2009-08-13 10:53:33 Re: totally different plan when using partitions + request