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 1hw5g3-0008Og-QJ for pgsql-general@arkaria.postgresql.org; Fri, 09 Aug 2019 14:15:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hw5g2-00068H-FT for pgsql-general@arkaria.postgresql.org; Fri, 09 Aug 2019 14:15:30 +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 1hw5g2-00067T-5W for pgsql-general@lists.postgresql.org; Fri, 09 Aug 2019 14:15:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw5fz-0006D4-Do for pgsql-general@lists.postgresql.org; Fri, 09 Aug 2019 14:15:29 +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 x79EFNOf004065; Fri, 9 Aug 2019 10:15:23 -0400 From: Tom Lane To: Harold Falkmeyer cc: pgsql-general@lists.postgresql.org Subject: Re: PostgreSQL 8.4 Tablespace Inconsistency In-reply-to: References: Comments: In-reply-to Harold Falkmeyer message dated "Thu, 08 Aug 2019 21:33:57 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4063.1565360123.1@sss.pgh.pa.us> Date: Fri, 09 Aug 2019 10:15:23 -0400 Message-ID: <4064.1565360123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Harold Falkmeyer writes: > As an example of the seeming inconsistency, pg_class indicated that certain > tables and indexes were on reltablespace 0, which, as we understood, refers > to pg_default, which, coincidentally is listed with pg_tablespace with oid > 1663. That same pg_class object is clearly present on the filesystem for a > non-default tablespace. No, reltablespace = 0 means that the relation is in its database's default tablespace; that's whatever pg_database.dattablespace says, not necessarily pg_default. The reason for this is basically to allow a database to be moved en-masse to another tablespace without having to update its pg_class. > As another example, pg_class lists no tables or indexes with one of our > non-default tablespace; though, that filesystem has a tablespace-like path > with many open files (lsof) listed whenever the database is running. Maybe those objects are in a different database of the cluster? Another thought is to take a close look at the symlinks in $PGDATA/pg_tblspc to verify that your tablespaces are pointing where you think they are. Note that pg_tablespace.spclocation is not authoritative on this; the symlinks are. regards, tom lane