Re: Second maximum value - Mailing list pgsql-sql

From Tom Lane
Subject Re: Second maximum value
Date
Msg-id 25018.1051459925@sss.pgh.pa.us
Whole thread Raw
In response to Second maximum value  (Marco Bubke <marco@bubke.de>)
List pgsql-sql
Marco Bubke <marco@bubke.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



pgsql-sql by date:

Previous
From: Marco Bubke
Date:
Subject: Second maximum value
Next
From: "lihao"
Date:
Subject: Pl Pgsql problem