From: Max <xdmaxx(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject:
Date: 2006-08-15 16:05:36
Message-ID: 71D7955E-C135-44B1-A5DF-8F41A57FFAAE@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

  • Re: at 2006-08-15 16:27:57 from Jeff Davis

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2006-08-15 16:06:15 Re: Using SETOF functions in SQL
Previous Message Ludwig Isaac Lim 2006-08-15 16:05:14 Unable to Start PostgreSQL 8.1.4 on Windows XP