Re: how to add more than 1600 columns in a table?

From: pabloa98 <pabloa98(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: how to add more than 1600 columns in a table?
Date: 2019-04-24 22:11:35
Message-ID: CAEjudX7BeWcL0xbYeTwVnBafVK3uHn0ABEkf7cgf8wE0MY6C9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you Joe! I will take a look

Pablo

On Wed, Apr 24, 2019 at 1:47 PM Joe Conway <mail(at)joeconway(dot)com> wrote:

> On 4/24/19 4:17 PM, pabloa98 wrote:
> > Sadly today we hit the 1600 columns limit of Postgresql 11.
> >
> > How could we add more columns?
> >
> > Note: Tables are OK. We truly have 2400 columns now. Each column
> > represents a value in a matrix.
>
> As everyone else has mentioned, your use case sounds like arrays are
> appropriate. Note that PostgreSQL supports 2 dimensional (actually more
> than 2d if you wanted) arrays which are essentially perfect for
> representing a matrix.
>
> If this works for your data model it will likely save a ton of storage
> space and perform much better than alternatives.
>
> FWIW, if you are needing to do matrix math, you might want to look into
> PL/R (https://github.com/postgres-plr/plr) as it supports 2d arrays as
> arguments which are converted directly into R matrices.
>
> I don't know for sure but likely PL/Python could be used to process
> matrices as well.
>
> HTH,
>
> Joe
>
> --
> Crunchy Data - http://crunchydata.com
> PostgreSQL Support for Secure Enterprises
> Consulting, Training, & Open Source Development
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pabloa98 2019-04-24 22:14:13 Re: how to add more than 1600 columns in a table?
Previous Message pabloa98 2019-04-24 22:11:04 Re: how to add more than 1600 columns in a table?