Re: acessibility for tables

From: Philipp Kraus <philipp(dot)kraus(at)flashpixx(dot)de>
To: Willy-Bas Loos <willybas(at)gmail(dot)com>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: acessibility for tables
Date: 2012-06-06 12:09:13
Message-ID: EA94402A-9264-4798-8099-99BA2D091B07@flashpixx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Anfang der weitergeleiteten E-Mail:

> Von: Willy-Bas Loos <willybas(at)gmail(dot)com>
> Datum: 6. Juni 2012 13:57:45 MESZ
> An: Kraus Philipp <philipp(dot)kraus(at)flashpixx(dot)de>
> Kopie: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, pgsql-general(at)postgresql(dot)org
> Betreff: Re: [GENERAL] acessibility for tables
>
> Do you mean, you want everyone to see the data, but only the "owner" can
>
> I would like to modify not only one field, but rather the whole record.
> No problem, only don't let them change the owner
>
> I thin NEW is the record of the view with the updated data and OLD the
> orginal records (similar to trigger & stored procedure).
> yes
>
> I would like to set OLD to NEW if the owner field is correct like:
> No need to do that. The UPDATE does this already. If you change NEW, then you are changing what the UPDATE does.
>
>
> Can I do this with the rule on the view?
> You could, but you should definitely look into triggers, like Albe said.
>
> Also, you asked if this is a good idea.
> Well, it works. But it is certainly not advisable to use the postgres authorisation system for anything else than postgres. I mean, don't try to use this for a web site of sorts.
> Then there are other ways to do it, if you really just want to make a database. Maybe inheritance could come in handy: a table per user and a parent table with select-only rights for all. (http://www.postgresql.org/docs/9.1/static/ddl-inherit.html)

That seems to be nice with inherits. My system works only within the LAN, but I can't do authentification or anything else in my software because the software are only scripts that can / should be modify by the user. So all access & authentification must be within the database. My idea is to create for each user, which should work with the database, a own postgres login and do the accessibility on the database.

Thanks

Phil

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2012-06-06 13:12:59 Re: Problem while restoring a database from SQL_ASCII to UTF-8
Previous Message Pavel Stehule 2012-06-06 12:02:28 Re: column definition for setof record functions (like dblink and crosstabs)