Re: Trigger on 'create table' ?

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Bruce David <brucedavid(at)bigfoot(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger on 'create table' ?
Date: 2002-10-28 18:53:29
Message-ID: 3DBD87A9.1020101@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Perhaps you can define a base class (table) and let others inherit from it.

Bruce David wrote:

>All,
>
>I'm trying to implement row level security using PostgreSQL. I envision
>having column on each and every table in the database that will contain a
>discriminating value that determines if a given user is able to see that row
>or not. Users do not directly access the database; they get at it only
>through client applications.
>
>Is there a way to initially configure PostgreSQL such that each and every
>time a 'create table foo....' command is executed that, something else would
>happen instead?
>
>For example,
>
>CREATE TABLE weather (
> city varchar(80),
> lo int,
> hi int,
> prcp real,
> date date
>);
>
>would result in the following being executed automatically:
>
>CREATE TABLE t_weather (
> city varchar(80),
> lo int,
> hi int,
> prcp real,
> date date,
> hidden_column int
>);
>
>CREATE VIEW weather AS
> SELECT city, lo, hi, prcp, date
> FROM t_weather;
>
>
>How the view gets populated is another discussion entirely.
>
>But is there a way to set things up initially such that each 'create table'
>command will exhibit the behavior described above?
>
>Thanks.
>
>--
>
>Bruce
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Medi Montaseri 2002-10-28 18:56:32 Re: supplying password to psql on command line?
Previous Message Neil Conway 2002-10-28 18:50:42 Re: What is the max var I can pass to Function ?