pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tobias Lott <tobias.lott@devoteam.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: permission denied for pg_temp_XX when vacuuming
Date: Wed, 03 Mar 2021 11:10:28 -0500
Message-ID: <1182966.1614787828@sss.pgh.pa.us> (raw)
In-Reply-To: <CANCOamzGsTavN-JyMp85yAJRFB2bXberotvWFjn_SkFHg6jg_g@mail.gmail.com>
References: <CANCOamzvWnviA+_ZPAUUYV=kW9_QOLNSJ7RzE4APYe-_DhtJfQ@mail.gmail.com>
	<aa0752c327533fb9b2970618cdf2f28a800cdaee.camel@cybertec.at>
	<1180816.1614784546@sss.pgh.pa.us>
	<CANCOamzGsTavN-JyMp85yAJRFB2bXberotvWFjn_SkFHg6jg_g@mail.gmail.com>

Tobias Lott <tobias.lott@devoteam.com> writes:
> Yes that's strange. A lot of pg_XX tables are skipped, but some of these
> pg_temp schemas cause errors.
> Could it be connected to a migration of the database (from an instance
> running PostgreSQL 9.6 to an instance running PostgreSQL 12) done a few
> weeks ago?

I wouldn't have expected a migration to bring any temp tables forward.

Have you had any crashes on this instance (post-migration)?  A possible
theory is that crashed backend(s) left behind some temp tables, and then
if vacuumdb's backend process re-uses the backend ID (which determines
the NN in pg_temp_NN) of one of those sessions, it would think those
temp tables are its own and try to vacuum them.  Or at least I think
it might.  That still fails to explain the permissions errors in any
detail, but at least it offers a reason why vacuumdb would even be
going anywhere near a temp table.

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <1182966.1614787828@sss.pgh.pa.us>
Permalink:  ../1182966.1614787828@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1182966.1614787828@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, tobias.lott@devoteam.com, laurenz.albe@cybertec.at
  Subject: Re: permission denied for pg_temp_XX when vacuuming
  In-Reply-To: <1182966.1614787828@sss.pgh.pa.us>
  References: <CANCOamzvWnviA+_ZPAUUYV=kW9_QOLNSJ7RzE4APYe-_DhtJfQ@mail.gmail.com> <aa0752c327533fb9b2970618cdf2f28a800cdaee.camel@cybertec.at> <1180816.1614784546@sss.pgh.pa.us> <CANCOamzGsTavN-JyMp85yAJRFB2bXberotvWFjn_SkFHg6jg_g@mail.gmail.com> <1182966.1614787828@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