Re: How to allocate a global variable (to implement virutal databases)

Lists: pgsql-hackers
From: Juan Manuel Diaz Lara <jmdiazlr(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to allocate a global variable (to implement virutal databases)
Date: 2006-04-29 18:24:18
Message-ID: 20060429182418.44331.qmail@web60325.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I would like to implement a row-level security for application-level-user (the user is not a postgresql user), I wish to restrict access to rows in diferent tables based on this application-level-user. My idea is to use rules to rewrite queries based on the contents of a global variable that is set with the application-level-userid, to this end I like to set the variabale at connection-time only, and aplied to all queris by the rewrite rules.

I think I can write a c-function but I do not know the correct way to allocate memory with session duration, maybe simply with alloc (o should I use palloc?).

Or is there a solution I do not know about?

Thanks.

Atte.

Juan Manuel Díaz Lara

---------------------------------
Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Juan Manuel Diaz Lara <jmdiazlr(at)yahoo(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to allocate a global variable (to implement virutal databases)
Date: 2006-04-29 18:57:03
Message-ID: 25699.1146337023@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Juan Manuel Diaz Lara <jmdiazlr(at)yahoo(dot)com> writes:
> I would like to implement a row-level security for
> application-level-user (the user is not a postgresql user),

Have you looked at Veil?
http://veil.projects.postgresql.org/

regards, tom lane


From: Juan Manuel Diaz Lara <jmdiazlr(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to allocate a global variable (to implement virutal databases)
Date: 2006-04-29 20:00:12
Message-ID: 20060429200012.37483.qmail@web60312.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thanks, but from the vail site "windows sorry"... I am working in windows.

I was thinking in a simply implementation, with only global variables used with the rule system.

I can write the c code for this.

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
Juan Manuel Diaz Lara writes:
> I would like to implement a row-level security for
> application-level-user (the user is not a postgresql user),

Have you looked at Veil?
http://veil.projects.postgresql.org/

regards, tom lane

Atte.

Juan Manuel Díaz Lara

---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.