Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kw79w-0000GH-3r for pgsql-general@arkaria.postgresql.org; Sun, 03 Jan 2021 17:27:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kw79s-00071K-F8 for pgsql-general@arkaria.postgresql.org; Sun, 03 Jan 2021 17:27:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kw79s-00070x-7L for pgsql-general@lists.postgresql.org; Sun, 03 Jan 2021 17:27:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kw79o-0002O2-7e for pgsql-general@lists.postgresql.org; Sun, 03 Jan 2021 17:27:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 103HR4p82691847; Sun, 3 Jan 2021 12:27:04 -0500 From: Tom Lane To: Thomas Flatley cc: "pgsql-general@lists.postgresql.org" Subject: Re: Max# of tablespaces In-reply-to: References: Comments: In-reply-to Thomas Flatley message dated "Sun, 03 Jan 2021 12:59:31 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2691845.1609694824.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 03 Jan 2021 12:27:04 -0500 Message-ID: <2691846.1609694824@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Flatley writes: > Hello, I've checked the docs but cant seem to find if there is a max # o= f tablespaces allowed - I've come across a 9.5 env with 1600 tablespaces -= they want to double that - Oracle's max is 64k, I'm not particularly worr= ied about hitting a wall, if there is one , outside of maintenance issues = - any assistance would be greatly appreciated. There's no particular hard limit, though you might start to run into OID-starvation problems at a billion or so tablespaces. On the other hand, it's important to realize that a Postgres tablespace doesn't really *do* anything. It's just a separate subdirectory. The only functional reason to use a tablespace is if you can place it on a separate filesystem. There is certainly value in being able to do that --- but I've never heard of systems having more than a few dozen filesystems mounted. Hence, the above issue sounds suspiciously like somebody is expecting Postgres tablespaces to do something they don't do. (I suppose if you are working on a system that has limits on the number of files per directory, or performance problems with large values of that, then you could use tablespaces as a workaround. But TBH you'd be better off moving onto a more modern platform.) regards, tom lane