Re: maximum size limit for a query string?

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: maximum size limit for a query string?
Date: 2011-06-07 22:31:12
Message-ID: BANLkTim3A-YXWcn5XYUv_eQ=74qQ4t+TXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 7, 2011 at 2:38 PM, Andreas Kretschmer
<akretschmer(at)spamfence(dot)net> wrote:
> Yeah, i think, 16 MByte isn't the real limit, yes. And i've seen
> queries larger than that limit, but i can't find the link, sorry.
> (maybe depesz.com, dunno, can't remember, i'm sorry)

The thread linked seems to mainly be talking about MySQL, which has a
max_allowed_packet limit of something like 16 MB by default, but can
be adjusted upwards[1]. For Postgres, we can have COPY statements sent
over the network, limited only by your disk space, since these are
sent (and parsed, I think) buffer-by-buffer. If you do
pg_dump --table=big_table | pg_restore
you should see a giant COPY statement constructed; these can obviously
be arbitrarily large.

As for SQL statements that have to be constructed in-memory on the
client, and parsed/planned on the server all-at-once, I don't know of
any limits, other than maybe running out of memory somewhere.

Josh

--
[1] http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-06-07 22:32:52 Re: maximum size limit for a query string?
Previous Message Vibhor Kumar 2011-06-07 22:25:23 Re: maximum size limit for a query string?