Re: Second maximum value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marco Bubke <marco(at)bubke(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Second maximum value
Date: 2003-04-27 16:12:05
Message-ID: 25018.1051459925@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Marco Bubke <marco(at)bubke(dot)de> writes:
> create type counter_max as (
> maximum real,
> value int );

> create or replace function x_max(counter_max, real) returns counter_max as '
> declare
> maxi alias for $1;
> value alias for $2;
> result counter_max;

I think at the moment you need to say

result counter_max%rowtype;

Otherwise plpgsql thinks "result" has scalar type and doesn't do the
right things.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-04-28 08:54:00 Re: Pl Pgsql problem
Previous Message Marco Bubke 2003-04-27 10:37:53 Second maximum value