Re: Incorrect mention of number of columns?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: "Daniel Westermann (DWE)" <daniel(dot)westermann(at)dbi-services(dot)com>
Cc: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Incorrect mention of number of columns?
Date: 2023-11-03 16:12:14
Message-ID: CABUevEwR7-6Ki+mH5zG4nAHMRFEK-GMu--D1qcDaF9yn9+8kVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, Nov 3, 2023 at 5:09 PM Daniel Westermann (DWE)
<daniel(dot)westermann(at)dbi-services(dot)com> wrote:
>
> Hi,
>
> from the limits page in the docs: https://www.postgresql.org/docs/current/limits.html
>
> "...but a tuple of 1600 bigint columns would consume 12800 bytes and would therefore not fit inside a heap page".
>
> Creating a table with 1600 bigint columns does work with a 8k blocksize:
>
> $ cat gen_tab.sh
> #!/bin/bash
> AMOUNT_OF_COLS=$1
> DATA_TYPE=$2
> STATEMENT="create table t ( "
> for (( i=1 ; i<${AMOUNT_OF_COLS} ; i++ ));
> do
> STATEMENT+=" col${i} ${DATA_TYPE},"
> done
> STATEMENT+="col${AMOUNT_OF_COLS} ${DATA_TYPE} );"
> echo ${STATEMENT}
>
> .$ /gen_tab.sh 1600 bigint > a.sql
>
> $ psql -f a.sql
> CREATE TABLE
>
> $ psql -c "\d t"
> ...
> col1598 | bigint | | |
> col1599 | bigint | | |
> col1600 | bigint | | |
>
> Am I missing something?

It will fail when you try to insert data in it.

//Magnus

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2023-11-03 16:12:37 Re: Incorrect mention of number of columns?
Previous Message Daniel Westermann (DWE) 2023-11-03 16:09:33 Incorrect mention of number of columns?