pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Steve - DND <postgres@digitalnothing.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Pagination with Output Variables?
Date: Tue, 22 Feb 2005 17:26:57 -0700
Message-ID: <20050223002657.GA80291@winnie.fuhr.org> (raw)
In-Reply-To: <LDEHKBBOEMIJKHKBOFNFOENBLKAA.postgres@digitalnothing.com>
References: <LDEHKBBOEMIJKHKBOFNFOENBLKAA.postgres@digitalnothing.com>

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/



view thread (2+ messages)

Message-ID: <20050223002657.GA80291@winnie.fuhr.org>
Permalink:  ../20050223002657.GA80291@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050223002657.GA80291@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, postgres@digitalnothing.com
  Subject: Re: Pagination with Output Variables?
  In-Reply-To: <20050223002657.GA80291@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox