Re: [GENERAL] DROP [TEMP] TABLE syntax, as reason why not? - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] DROP [TEMP] TABLE syntax, as reason why not?
Date
Msg-id CAKFQuwaAS15tz7fj4VVTF7VvY_dK=Q71HQXOUko8cLOhNrJtxA@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] DROP [TEMP] TABLE syntax, as reason why not?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Aug 23, 2017 at 6:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> I'm wondering if there is anything technical preventing someone from making:

> DROP TEMP TABLE tablename;

There is no great need for that because you can get the semantics you're
asking for with "DROP TABLE pg_temp.tablename".

Furthermore, as a matter of good database management ideally the role creating and dropping temporary tables is different from the role that retains ownership​ of permanent tables - so that even if the wrong table was selected object permissions would prevent its being dropped.

I don't think I'd -1 a patch that attempted to provide some incremental improvement here but I just don't see one being written or getting enough support to go through.  And that doesn't bother me - even if I was in a position to do so I likely wouldn't write one at this point.

David J.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Retrieving query results
Next
From: Dmitry Lazurkin
Date:
Subject: [GENERAL] Change location of function/type installed from C-extension