Thread: vacuumdb: permission denied for schema "pg_temp_7"

vacuumdb: permission denied for schema "pg_temp_7"

From
vaibhave postgres
Date:
Repo steps

1. Create a temporary table

sample => CREATE TEMPORARY TABLE temp_employees (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100),
    position VARCHAR(50),
    salary NUMERIC(10, 2)
);
CREATE TABLE
sample  => \dt pg_temp_*.*
               List of relations
  Schema   |      Name      | Type  |  Owner
-----------+----------------+-------+----------
pg_temp_7 | temp_employees | table | vaibhave
(1 row)

2. Run vacuumdb

vacuumdb: vacuuming database "sample"
vacuumdb: error: processing of database " sample  " failed: ERROR:  permission denied for schema pg_temp_7

Temporary tables can only be accessed within the session which created them. They should be skipped during vacuumdb. 

Suggested Patch is attached
Attachment