Re: No warning/error trying to vacuum other session's temp table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jerry Sievers <gsievers19(at)comcast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: No warning/error trying to vacuum other session's temp table
Date: 2019-08-27 18:51:39
Message-ID: 9768.1566931899@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jerry Sievers <gsievers19(at)comcast(dot)net> writes:
> As seen below, the command response VACUUM is output , but adding the
> VERBOSe keyword results in no additional output.

Yeah, per the code:

/*
* Silently ignore tables that are temp tables of other backends ---
* trying to vacuum these will lead to great unhappiness, since their
* contents are probably not up-to-date on disk. (We don't throw a
* warning here; it would just lead to chatter during a database-wide
* VACUUM.)
*/
if (RELATION_IS_OTHER_TEMP(onerel))
{
relation_close(onerel, lmode);
PopActiveSnapshot();
CommitTransactionCommand();
return false;
}

At the point where this is being done, we don't know whether the table was
explicitly named or not, so we really can't issue a message. Perhaps it'd
make sense to add an additional test earlier, where we do know that.
On the other hand, nobody has ever complained about this before.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message stan 2019-08-27 22:27:41 Work hours?
Previous Message Bikram Majumdar 2019-08-27 18:39:12 Re: Question on pgwatch