Search Postgresql Archives

Restricted query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello list,

This is an inventory system where some users are restricted to view only certain suppliers, those restrictions are in a table called pedusers (username,supplierallowed), there are other kind of "superuser" who are not restricted, actually I created another table for them (userexcept). To select restricted rows I use this code:

select *  from prvdor
where prvtiprov = 2 and
prvpk in
(select usr_prvdor from peduser where
usr_login = 'default')


I think I would write this in a return set function instead but I would like to know others ways to write a SQL sentence to return the rows according users permission/restrictions.



Thanks in advance for your comments




--
Sinceramente,
Josué Maldonado.

"Vivir sin filosofar es, propiamente, tener los ojos cerrados, sin tratar de abrirlos jamás." -- Descartes

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux