Read/Write restriction mechanism

From: Naz Gassiep <naz(at)mira(dot)net>
To: "pgsql-general(at)postgresql(dot)org >> Postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: Read/Write restriction mechanism
Date: 2008-01-09 06:39:08
Message-ID: 47846C0C.70407@mira.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A tangentially PG related question:

In a PHP project I have several functions that I use for DB operations.
I only want to allow one of them to write, all the others are for
reading only. I was thinking that a way I can enforce this would be to
check that the read only ones only have queries where the first
non-whitespace character is 'S'. This is not a security thing, user
defined queries are totally disallowed, this is just a "so developers
don't forget" measure.

Checking the first char like that seems awfully hackinsh to me, although
I can't see any reason it wouldn't work. Does anyone have any better
ideas? (Using DB level perms are out, as this is the function usage I'm
trying to control, not the connections).

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2008-01-09 06:40:29 Re: Experiences with extensibility
Previous Message Guido Neitzer 2008-01-09 06:37:38 Re: Experiences with extensibility