Re: Can user specification of a column value be required when querying a view ?

Поиск
Список
Период
Сортировка
От David Gauthier
Тема Re: Can user specification of a column value be required when querying a view ?
Дата
Msg-id CAEs=6DnJsbA03tbWvQNOXcX0HwPuiRjxpBYLO4TQAFWjsirJ-Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Can user specification of a column value be required when querying a view ?  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-general
OK, didn't think so, just checking.  Thanks for verifying ! 

On Mon, Nov 20, 2023 at 4:45 PM Christophe Pettus <xof@thebuild.com> wrote:


> On Nov 20, 2023, at 13:41, David Gauthier <dfgpostgres@gmail.com> wrote:
> I want the users to be required to provide a value for ssn in the following query...
> "select * from huge_view where ssn = '106-91-9930' "
> I never want them to query the view without specifying ssn.
> It has to do with resources and practicality.
>
> Is there a way to do that ?

Not in a way that PostgreSQL itself will enforce.  If you are concerned about a query running wild and taking up resources, setting statement_timeout for the user that will be running these queries is the best way forward.  A user that has general access to PostgreSQL and can run arbitrary queries will be able to craft a query that takes up a lot of system time and memory without too much trouble.

В списке pgsql-general по дате отправления:

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: Re: Can user specification of a column value be required when querying a view ?
Следующее
От: Alan Hodgson
Дата:
Сообщение: Re: Can user specification of a column value be required when querying a view ?