pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Harold Falkmeyer <hfalkmeyer@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PostgreSQL 8.4 Tablespace Inconsistency
Date: Fri, 09 Aug 2019 10:15:23 -0400
Message-ID: <4064.1565360123@sss.pgh.pa.us> (raw)
In-Reply-To: <CACcYrit01CxJ=z89Hv5ZCA39TVyi4HKxcFCpKBJs_9f-BmKoRg@mail.gmail.com>
References: <CACcYrit01CxJ=z89Hv5ZCA39TVyi4HKxcFCpKBJs_9f-BmKoRg@mail.gmail.com>

Harold Falkmeyer <hfalkmeyer@gmail.com> 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





view thread (3+ messages)  latest in thread

Message-ID: <4064.1565360123@sss.pgh.pa.us>
Permalink:  ../4064.1565360123@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4064.1565360123@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hfalkmeyer@gmail.com
  Subject: Re: PostgreSQL 8.4 Tablespace Inconsistency
  In-Reply-To: <4064.1565360123@sss.pgh.pa.us>
  References: <CACcYrit01CxJ=z89Hv5ZCA39TVyi4HKxcFCpKBJs_9f-BmKoRg@mail.gmail.com> <4064.1565360123@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox