X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1B1D5474E42 for ; Sun, 27 Apr 2003 12:12:43 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 1209C474E42 for ; Sun, 27 Apr 2003 12:12:12 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3RGC6U6025019; Sun, 27 Apr 2003 12:12:06 -0400 (EDT) To: Marco Bubke Cc: pgsql-sql@postgresql.org Subject: Re: Second maximum value In-reply-to: <3EABB301.5040000@bubke.de> References: <3EABB301.5040000@bubke.de> Comments: In-reply-to Marco Bubke message dated "Sun, 27 Apr 2003 12:37:53 +0200" Date: Sun, 27 Apr 2003 12:12:05 -0400 Message-ID: <25018.1051459925@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-29.1 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/403 X-Sequence-Number: 13104 Marco Bubke 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