Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJQnZ-0006eU-Tb for pgsql-general@arkaria.postgresql.org; Wed, 24 Apr 2019 22:55:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hJQnY-000217-D2 for pgsql-general@arkaria.postgresql.org; Wed, 24 Apr 2019 22:55:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJQnY-000210-2g for pgsql-general@lists.postgresql.org; Wed, 24 Apr 2019 22:55:28 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJQnV-00067V-1u for pgsql-general@lists.postgresql.org; Wed, 24 Apr 2019 22:55:27 +0000 Received: by mail-qk1-x742.google.com with SMTP id p19so9578008qkm.10 for ; Wed, 24 Apr 2019 15:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=M5RdjdTMAxx33ruAKTqfwQc7r35pP2/fR6+jzhPYaP0=; b=ZIOS5kODv39c2kB2K2zmTZn+bvqsFiMlvh8r79T197a0ItBJFDBT2xs9b4VF8ndGXQ rxmZSZiHIF37iFOpcYb7fV9ncVXAjph4xAK9KCDyOhrjqCnN1u9KAmyMJ+6MLKn5kQPx uIIWevQPmoC51RlLXq60jWte2XIfTyNvTDDtEZ+73C7ow7CC9DiuWK44NSEsNZcN0JPn EvIW9B5koDTuimbDBXTaZvdje0mBZkJuJZZ7ZU+EtidvSywHdY28Y972LzEbzME0A80d IPgn8tipX6VwkO8olinIUo9XVIHfQC49OHRa2xoaB+yG4dVF60wiJ56vYMawb4edowFB JyNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=M5RdjdTMAxx33ruAKTqfwQc7r35pP2/fR6+jzhPYaP0=; b=r4ufcb6gqOBWuI1MQY91imteLyIqmL9ymDk3qJRIRdPwT8S2R17LZUfT5i3k2/zeM4 moF/hx17f3st3I22lCOkUF+/js6z6be0tjH7Nr0gBD0ZtpRuN1cDdqNrvEORTRLxLpTZ puc8R6e4aczgDYYacCo70pDJxktOdaIcem7wwj+LnDbOHopg9Pl67LO1dbGkseUvrd36 CcQa8+NGY8NFbkPqepQXbODoeBwDUWTlZgDv5JfCn6F9eEbyN5DyR2+wv7uyemOagNuz QTAtpol6UbxHpv40t/Eq3vb+klxzsJyLviBiHazUwlLkqf8BkVyLvfvI+kXHlAw3zPJ6 bM0A== X-Gm-Message-State: APjAAAWDUmawxfSCjMUrx5cCz+rnkMTeHhqPvTA38qdhbXDqu5bceSaf PB8H3qkk8koRo8IA7mgE8svovQ== X-Google-Smtp-Source: APXvYqwEqvWOHnGjQkx1P5nbEZI9Q/F8d2LDkdkJrsOAggfX1B2gB+3T0QcTVaqyPw9/h/D23uAAjw== X-Received: by 2002:a37:4896:: with SMTP id v144mr26149813qka.194.1556146523332; Wed, 24 Apr 2019 15:55:23 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id x15sm2558064qtp.9.2019.04.24.15.55.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 15:55:22 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 756911207D0; Wed, 24 Apr 2019 18:55:19 -0400 (-04) Date: Wed, 24 Apr 2019 18:55:19 -0400 From: Alvaro Herrera To: pabloa98 Cc: Gavin Flower , Joe Conway , "pgsql-generallists.postgresql.org" Subject: Re: how to add more than 1600 columns in a table? Message-ID: <20190424225519.GA8439@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Apr-24, pabloa98 wrote: > Regarding to (2), We are good by adding a patch and recompile a patched > version for our server databases. > > But we are open on helping to add thousands of columns support as a > compile-time parameter if there are other people interested. It's hard to say what you're doing wrong when we don't know what are you actually doing. I think raising the limit requires changing ItemIdData, t_hoff, and a few members of PageHeaderData at the very least. Reading the three header files involved carefully would probably point out areas I've forgotten to mention. I think if you enlarge t_hoff and lp_off/lp_len to 16 bits, you can use 64kB blocks, which might be useful too. Note that with pg12 you could have your own table AM that supported wider ItemIds as a (small?) change on heapam, rather than supplant it for all tables. That way you would only pay the (probably considerable) cost of the wider line pointers on all tables ... -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services