Re: feature proposal ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: feature proposal ...
Date
Msg-id 28654.1127400020@sss.pgh.pa.us
Whole thread Raw
In response to Re: feature proposal ...  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> So we could refute this argument by just not making the permission check for
>> CREATE TEMP VIEW.

> This is the first time I've ever heard of CREATE TEMP VIEW. What's the point
> of it since you can always directly do:
>   SELECT * FROM (...)
> ?

Separation of concerns, for one thing: the code using the view need not
know the exact contents of the select, or perhaps not even have
permissions to access the underlying tables.  (Think of a temp view
created by a SECURITY DEFINER function for instance.)  In this
particular case it gives us separation of concerns in a different way,
ie, we don't have to figure out a way to force-fit the complete syntax
of SELECT inside a COPY command.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Why does VACUUM FULL bother locking pages?
Next
From: "Jonah H. Harris"
Date:
Subject: Hierarchical Queries--Stalled No Longer...