mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-27 07:21:09 +08:00
Fix contrib/pgstattuple and contrib/pageinspect to prevent attempts to read
temporary tables of other sessions; that is unsafe because of the way our buffer management works. Per report from Stuart Bishop. This is redundant with the bufmgr.c checks in HEAD, but not at all redundant in the back branches.
This commit is contained in:
parent
e3c0d679dc
commit
ed00200dac
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.12.4.1 2004/10/13 22:22:00 tgl Exp $
|
* $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.12.4.2 2009/03/31 22:56:28 tgl Exp $
|
||||||
*
|
*
|
||||||
* Copyright (c) 2001,2002 Tatsuo Ishii
|
* Copyright (c) 2001,2002 Tatsuo Ishii
|
||||||
*
|
*
|
||||||
@ -117,6 +117,16 @@ pgstattuple_real(Relation rel)
|
|||||||
int i;
|
int i;
|
||||||
Datum result;
|
Datum result;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reject attempts to read non-local temporary relations; we would
|
||||||
|
* be likely to get wrong data since we have no visibility into the
|
||||||
|
* owning session's local buffers.
|
||||||
|
*/
|
||||||
|
if (isOtherTempNamespace(RelationGetNamespace(rel)))
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
|
errmsg("cannot access temporary tables of other sessions")));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Build a tuple description for a pgstattupe_type tuple
|
* Build a tuple description for a pgstattupe_type tuple
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user