pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Igor Korot <ikorot01@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Retrieving query results
Date: Thu, 24 Aug 2017 19:18:47 -0400
Message-ID: <17616.1503616727@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+FnnTwY0mZ1cO8hhBW2sOOGjXaVqfhECUKL6S_cZ6z2LUfcQw@mail.gmail.com>
References: <CA+FnnTxyLWyjY1goewmJNxC==HQCCF4fKkoCTa9qR36oRAHDPw@mail.gmail.com>
	<CAB7nPqTzPvrwDakXjogGCLZGfMpQO1AMWY3e3RMp7SsDGvdUSw@mail.gmail.com>
	<32584.1503579096@sss.pgh.pa.us>
	<CA+FnnTxaA2cuEQiMx4-XFwBX3mdFL5wRq_xcN_+chNM-HdQtYg@mail.gmail.com>
	<14978.1503586593@sss.pgh.pa.us>
	<CAB7nPqSE5voeA5LTDZ6PLkA4jNWuYB7nJJTaXRJBREH2LJE2Fg@mail.gmail.com>
	<CA+FnnTwY0mZ1cO8hhBW2sOOGjXaVqfhECUKL6S_cZ6z2LUfcQw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

Igor Korot <ikorot01@gmail.com> writes:
> So there is no way to retrieve an arbitrary number of rows from the query?
> That sucks...

The restriction is on the number of rows in one PGresult, not the total
size of the query result.  You could use single-row mode, or use a cursor
and fetch some reasonable number of rows at a time.  If you try to inhale
all of a many-gigarow result at once, you're going to have OOM problems
anyway, even if you had the patience to wait for it.  So I don't think the
existence of a limit is a problem.  Failure to check it *is* a problem,
certainly.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (17+ messages)  latest in thread

Message-ID: <17616.1503616727@sss.pgh.pa.us>
Permalink:  ../17616.1503616727@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17616.1503616727@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ikorot01@gmail.com, michael.paquier@gmail.com
  Subject: Re: Retrieving query results
  In-Reply-To: <17616.1503616727@sss.pgh.pa.us>

* 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