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

Поиск
Список
Период
Сортировка
От Steve Baldwin
Тема Re: Can user specification of a column value be required when querying a view ?
Дата
Msg-id CAKE1AiZ4rgr4-MPowDH22NjY5e6iuph7JGXCG2AadPK7YS8_Aw@mail.gmail.com
обсуждение исходный текст
Ответ на Can user specification of a column value be required when querying a view ?  (David Gauthier <dfgpostgres@gmail.com>)
Список pgsql-general
Maybe you could create a function that has a required parameter, so rather than 'select * from huge_view where .." they do 'select * from function(some_ssn) [where...]' ?

That function would then query the view using the supplied ssn.

Just a thought.

Steve

On Tue, Nov 21, 2023 at 8:41 AM David Gauthier <dfgpostgres@gmail.com> wrote:
Hi:

I have a view that I want  to require user specification for a specific column before the query starts (if that makes sense).  

Example
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 ?
Thanks

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

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