Re: Can user specification of a column value be required when querying a view ? - Mailing list pgsql-general

From Christophe Pettus
Subject Re: Can user specification of a column value be required when querying a view ?
Date
Msg-id 1E154B80-1BF2-478A-987A-F28F58A4D1A8@thebuild.com
Whole thread Raw
In response to Can user specification of a column value be required when querying a view ?  (David Gauthier <dfgpostgres@gmail.com>)
Responses Re: Can user specification of a column value be required when querying a view ?
Re: Can user specification of a column value be required when querying a view ?
List pgsql-general

> 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
thathas general access to PostgreSQL and can run arbitrary queries will be able to craft a query that takes up a lot of
systemtime and memory without too much trouble. 


pgsql-general by date:

Previous
From: Steve Baldwin
Date:
Subject: Re: Can user specification of a column value be required when querying a view ?
Next
From: David Gauthier
Date:
Subject: Re: Can user specification of a column value be required when querying a view ?