postgresql add tag
newenglander (imported from SE)
I'm working with a Windows application that uses a (local) postgres Database and stores some information in a temporary table. I'd like to have a look at the temporary table, but pgadmin and dbVis tell me: `ERROR: cannot access temporary tables of other sessions` when trying to query the data. I tried changing the permissions of the schema and table, but this didn't seem to help, even though I'm accessing the database with the same user as the program itself (at least in dbVis). Is there a setting I can change in my database that allows me to have "root" access to all session in my database?
Top Answer
craig ringer (imported from SE)
The lack of access to temporary tables in other sessions is not a matter of permissions, it's a technical limitation of the design. A PostgreSQL backend *can't* access temporary tables of another backend because none of the usual housekeeping to allow concurrent access is done for temporary tables.

In 9.2 you will want to use an `UNLOGGED` table instead; this can be visible from other sessions, but retains most of the performance benefits of a temporary table.
Answer #2
Jack Douglas (imported from SE)
The short answer is "No". [Temporary tables](http://www.postgresql.org/docs/current/static/sql-createtable.html#AEN62073) in 
other sessions [are invisible](http://postgresql.1045698.n5.nabble.com/GENERAL-Temporary-table-visibility-td1856035.html) by design. It makes no difference if two sessions have the same user. Even:

> The autovacuum daemon cannot access and therefore cannot vacuum or
> analyze temporary tables

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.