Re: Rule recompilation

Поиск
Список
Период
Сортировка
От Alex Pilosov
Тема Re: Rule recompilation
Дата
Msg-id Pine.BSO.4.10.10107121412350.15496-100000@spider.pilosoft.com
обсуждение исходный текст
Ответ на Rule recompilation  (Jan Wieck <JanWieck@Yahoo.com>)
Ответы Re: Rule recompilation  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-hackers
I remember awhile ago, someone floated the idea of a dependency view which
would list all objects and what OIDs they have in their plan. (i.e. what
do they depend on). 

I'm definitely no expert in this, but to me, one possible implementation
would be to enhance outfuncs to provide for creation tracking of all
OIDs used in plan, and allow caller to receive this list and do something
with it. This would actually be very simple, as only _outOidList will need
to be modified...(but then again, I'm known for oversimplifying things :)

Then, we can add  ev_depends/oidvector to pg_rewrite and store the
dependency there, and for stored procedures, add a prodepends/oidvector to
pg_proc.

Then, create union of pg_rewrite and pg_proc to list dependencies.

Then, we would be able to provide warning when an object is dropped:
'The following objects depend on this blah blah', and possibly an action
"alter database fixdepends oid" which would recompile everything that
depends on that oid.

How's this sound?

On Thu, 12 Jul 2001, Jan Wieck wrote:

> Hi,
> 
>     I'd  like  to  add  another column to pg_rewrite, holding the
>     string representation of the  rewrite  rule.  A  new  utility
>     command  will  then  allow  to recreate the rules (internally
>     DROP/CREATE, but that doesn't matter).
> 
>     This would be a big help in case anything used in a  view  or
>     other  rules  get's  dropped  and  recreated (like underlying
>     tables). There is of course a difference between the original
>     CREATE  RULE/VIEW  statement and the string stored here. This
>     is because we cannot rely on the actual query buffer but have
>     to parseback the parsetree like done by the utility functions
>     used for pg_rules. Thus, changing a column  name  of  a  base
>     table will break the view either way.
> 
>     Anyway,  what's  the preferred syntax for triggering the rule
>     recompilation?  I thought about
> 
>         ALTER RULE {rulename|ALL} RECOMPILE;
> 
>     Where ALL triggers only those rules where the  user  actually
>     has RULE access right on a relation.
> 
> 
> Jan
> 
> --
> 
> #======================================================================#
> # It's easier to get forgiveness for being wrong than for being right. #
> # Let's break this rule - forgive me.                                  #
> #================================================== JanWieck@Yahoo.com #
> 
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 
> 





В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Magnus Naeslund\(f\)"
Дата:
Сообщение: Vacuum errors
Следующее
От: Alex Pilosov
Дата:
Сообщение: Re: Rule recompilation