Re: temp tables should not have pg_shdepend entries

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: temp tables should not have pg_shdepend entries
Date: 2008-04-08 16:34:13
Message-ID: 20080408163413.GE9062@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > Among the consequences of creating a temp table is the fact that we
> > create pg_shdepend entries for the owner. This is largely unnecessary
> > -- we only need it when the table owner is not the authenticated user.
> > I hereby propose we don't create those entries, since obviously the
> > tables would go away as soon as the connection goes away anyway, and the
> > user cannot go away until the connection does.
>
> But what if some application is using those dependencies while the
> session is running? What is the advantage of not having the entries?

The only use of the dependencies is to disallow dropping the user that
owns the table. But a connected user cannot be dropped.

... or so I thought :-( Actually you can delete a connected user, but
things do not go well after you do:

alvherre=> create table test (a int);
ERREUR: le rôle 32792 a été supprimé simultanément

So now my thinking is that we should disallow dropping a connected user.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-04-08 16:42:27 Re: File system snapshots for multiple file systems
Previous Message Tom Lane 2008-04-08 16:34:02 Re: Free Space Map data structure