How to restrict select from table with external validation?

Поиск
Список
Период
Сортировка
От Vladimir A. Petrov
Тема How to restrict select from table with external validation?
Дата
Msg-id 44B32AFF.1010804@infopac.ru
обсуждение исходный текст
Ответы Re: How to restrict select from table with external validation?  (Sean Davis <sdavis2@mail.nih.gov>)
Re: How to restrict select from table with external  (John Purser <jmpurser@gmail.com>)
Список pgsql-novice
Hello!

I have table like

CREATE TABLE stats
(
   username varchar(256) NOT NULL,
   "time" int8 NOT NULL,
   duration int4 NOT NULL,
   phonenumber varchar(20) NOT NULL,
   and so on ...
)

I have function like

CREATE OR REPLACE FUNCTION auth("varchar", "varchar")
   RETURNS bool AS '
...
' LANGUAGE 'plperlu' VOLATILE;

where first argument is username and second is password. This function
returns true if username and password validated successfully or false
otherwise.

I have a user which must do only selects from table "stats".

My questions is how to restrict access on table "stats" to this user in
way where this user will be able to select only limited set of columns
from table "stats" and only rows with usernames for which this user
knows correct passwords validated via auth() function call?

Any help will be appreciated.
--
Vladimir A. Petrov (aka vap)                    phone: (+7 8482) 420069
Infopac JSC. Head of the exploitation department.     http://infopac.ru
_______________________________________________________________________
^[:wq                                         ...sed libera nos a malo.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Data Types and Their Aliases
Следующее
От: Sean Davis
Дата:
Сообщение: Re: How to restrict select from table with external validation?