- Mailing list pgsql-general

From Max
Subject
Date
Msg-id 71D7955E-C135-44B1-A5DF-8F41A57FFAAE@gmail.com
Whole thread Raw
Responses Re:  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-general
Hello all.

I'm working on a kind of permissions management and I would like to
add restrictions on SELECT statements depending on certain fields of
a row.

tablename :
id,
perm_field1,
..
..
perm_field2,
data_field1,
data_field2,
...

Do you know if it is possible to write such things :

SELECT * FROM tablename WHERE permission(some parameters) == TRUE;

with the function 'permission' returning TRUE or FALSE after a check
on different perm_fields of the current row.

My problem is that I don't really know how to access to the fields of
the current row with an external function.

How could I write this ?

Thx for help.
Max




pgsql-general by date:

Previous
From: Pavel Velikhov
Date:
Subject: Using SETOF functions in SQL
Next
From: Jeff Davis
Date:
Subject: Re: Using SETOF functions in SQL