Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpdrm-000684-Dr for pgsql-general@arkaria.postgresql.org; Tue, 14 Aug 2018 18:16:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpdrk-0004af-MH for pgsql-general@arkaria.postgresql.org; Tue, 14 Aug 2018 18:16:24 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpdrk-0004aY-E9 for pgsql-general@lists.postgresql.org; Tue, 14 Aug 2018 18:16:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpdrd-0003dT-Kt for pgsql-general@lists.postgresql.org; Tue, 14 Aug 2018 18:16:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7EIGFXx007807; Tue, 14 Aug 2018 14:16:15 -0400 From: Tom Lane To: Mate Varga cc: pgsql-general@lists.postgresql.org Subject: Re: pg_upgrade with large pg_largeobject table In-reply-to: References: <6945.1534269481@sss.pgh.pa.us> Comments: In-reply-to Mate Varga message dated "Tue, 14 Aug 2018 20:06:36 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7805.1534270575.1@sss.pgh.pa.us> Date: Tue, 14 Aug 2018 14:16:15 -0400 Message-ID: <7806.1534270575@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mate Varga writes: >> Using the large-object API for things that tend to not actually be very >> large (which they aren't, if you've got hundreds of millions of 'em) is an >> antipattern, I'm afraid. > I know :( So maybe I need to do some refactoring in the application and > inline the lobs. The data is binary data with very high entropy (encrypted > stuff). Would you recommend bytea for that? Yeah, it'd likely be less of a pain-in-the-neck than text. You would need some sort of encoding anyway to deal with zero bytes and sequences that aren't valid per your encoding, so you might as well go with bytea's solution. regards, tom lane