X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3F8158B9E5B for ; Wed, 23 Feb 2005 00:27:04 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67842-06 for ; Wed, 23 Feb 2005 00:27:00 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id A12E78B9D2F for ; Wed, 23 Feb 2005 00:27:01 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j1N0QvcS038296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Feb 2005 17:27:00 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j1N0Qv3w080349; Tue, 22 Feb 2005 17:26:57 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j1N0QvOc080348; Tue, 22 Feb 2005 17:26:57 -0700 (MST) (envelope-from mfuhr) Date: Tue, 22 Feb 2005 17:26:57 -0700 From: Michael Fuhr To: Steve - DND Cc: pgsql-sql@postgresql.org Subject: Re: Pagination with Output Variables? Message-ID: <20050223002657.GA80291@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/259 X-Sequence-Number: 20370 On Tue, Feb 22, 2005 at 04:29:30PM -0700, Steve - DND wrote: > Can a function return two type results? So that the first type would be just > the total number of records, and the second type would be the resultset of > customers? The function could return a set of cursors, one for the query that returns the total number of records and one for the resultset. The 8.0 documentation has an example that should work in earlier versions as well (except for the dollar quoting): http://www.postgresql.org/docs/8.0/static/plpgsql-cursors.html See the example at the bottom of the page. -- Michael Fuhr http://www.fuhr.org/~mfuhr/