Re: Max array size

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Postgres User" <postgres(dot)developer(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Max array size
Date: 2008-06-30 20:29:41
Message-ID: 4799.1214857781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Postgres User" <postgres(dot)developer(at)gmail(dot)com> writes:
> Does anyone know the maximum number of elements allowed in a
> one-dimensional array? It looks like my script may add at least a
> couple million, not sure if it will hit a limit...

You'd hit the 1GB field size limit before you hit anything else,
at least in terms of hard limits. But the *practical* limit is likely
to be a whole lot less, especially if you are talking about a
variable-width datatype. Indexing into such a large array would
perform poorly.

I'd counsel redesigning your data representation. You'll be a lot
happier with the performance of a table with a couple million rows
than with an array with a couple million entries.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sheikh Salman Ahmed 2008-06-30 20:37:29 Query Fails
Previous Message Postgres User 2008-06-30 20:16:43 Max array size