Re: Rules and views (was Re: [HACKERS] Rules: 2nd patch) - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: Rules and views (was Re: [HACKERS] Rules: 2nd patch)
Date
Msg-id m0z9EJW-000EBPC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: Rules and views (was Re: [HACKERS] Rules: 2nd patch)  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Patch adding pg_rule and pg_view  (jwieck@debis.com (Jan Wieck))
List pgsql-hackers
>
> >     If nobody votes against, I would like to make  them  builtins
> >     as  pg_get_ruledef()  and pg_get_viewdef() and then setup the
> >     appropriate views  (pg_rule  and  pg_view)  in  template1  by
> >     initdb  like we do it with pg_user. It cannot break anything,
> >     except that a rule action the  two  functions  cannot  handle
> >     will  make  the new views unusable.  But it would be a really
> >     powerful possibility for pg_dump or just useful to  see  what
> >     that damn event qual and parsetree's in pg_rewrite came from.
> >
> >     Comments?
> >
>
> Go, Jan, go.

    You'll  get  it  after the currently running clean compile of
    the initial source tree (with the patch applied) and the rest
    went through.

>
> --
> Bruce Momjian                          |  830 Blythe Avenue

    For the rule permissions:

    I  think  it  would be O.K. to check the rule actions against
    the owner of their event relation. And the creator/destructor
    must  be  the owner of it or a superuser. This way, a regular
    user can do with rules anything he want's on  the  tables  he
    has  access to and as soon as he grant's access to his tables
    the granted user can use them as he would including the  rule
    actions.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Rules and views (was Re: [HACKERS] Rules: 2nd patch)
Next
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Patch adding pg_rule and pg_view