Re: [HACKERS] Rule recompilation

2001-07-12 Thread Hiroshi Inoue
Tom Lane wrote: > > Hiroshi Inoue <[EMAIL PROTECTED]> writes: > > We would have to reconsider *alter table .. rename ..* .. > > Yeah, that's one thing that would act differently if we adopt my idea of > considering the source text of the rule to be the primary definition. > It's not clear if this

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Hiroshi Inoue <[EMAIL PROTECTED]> writes: > We would have to reconsider *alter table .. rename ..* .. Yeah, that's one thing that would act differently if we adopt my idea of considering the source text of the rule to be the primary definition. It's not clear if this is good or bad, however. Con

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Hiroshi Inoue
Tom Lane wrote: > > Jan Wieck <[EMAIL PROTECTED]> writes: > > What everyone else is telling you is that we should strive to do the > same, not punt and make the user tell us when to recompile. > In Oracle, objects like views, functions and triggers are just marked INVALID when an object to whic

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jean-Michel POURE
IMHO we are trying to have a compiled language behave like an interpreted language. This is a bottom to top approach with no real future. Here is a proposal of a top to bottom approach. What we do in pgAdmin is that we store objects (functions, views and triggers) in separate tables called Dev

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > You cannot control Tcl's bytecode compiler from the outside. An excellent example. You don't *need* to control Tcl's bytecode compiler from the outside, because *Tcl gets it right without help*. It takes care of the function-text-to-derived-form depen

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
On Thu, 12 Jul 2001, Jan Wieck wrote: > Alex Pilosov wrote: > > 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

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > For most objects, there is no such "recompile" possible - at > least not without storing alot more information than now. > Create a function and based on that an operator. Then you > drop the function and create another one. Hmmm,

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Peter Eisentraut
Jan Wieck writes: > For most objects, there is no such "recompile" possible - at > least not without storing alot more information than now. > Create a function and based on that an operator. Then you > drop the function and create another one. Hmmm, pg_operator > d

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > Stop! > We're talking about two different things here. You're right: fixing obsoleted querytrees stored in pg_rewrite and similar catalogs is not the same thing as invalidating cached query plans in plpgsql, SPI, etc. However, we could turn them in

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > > In the PL/pgSQL case it *might* be possible. But is it worth > > it? > > Yes. If we're not going to do it right, I think we needn't bother to do > it at all. "Restart your backend" is just as good an answer, probably > better

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
On Thu, 12 Jul 2001, Peter Eisentraut wrote: > Jan Wieck writes: > > > For most objects, there is no such "recompile" possible - at > > least not without storing alot more information than now. > > Create a function and based on that an operator. Then you > > drop the

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > 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 functio

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > This isn't local recompilation in current backend. It's > > recreation of the pg_rewrite entry for a relation, including > > propagation. > > Where I'd like to go (see my previous mail) is that pg_rewrite, > pg_attrdef,

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Tom Lane wrote: > Jan Wieck <[EMAIL PROTECTED]> writes: > > 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 d

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > This isn't local recompilation in current backend. It's > recreation of the pg_rewrite entry for a relation, including > propagation. Where I'd like to go (see my previous mail) is that pg_rewrite, pg_attrdef, and friends store *only* the

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > And PL/pgSQL? We don't prepare all the statements into SPI > plans at compile time. We wait until the separate branches > are needed, so how do you know offhand here? If we haven't prepared a statement yet, then we don't need to reprepare

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > are you sure that this doesn't have a severe performance > impact? It's not provable, of course, until we try it ... but I think the performance impact would be small. Has anyone complained about the fact that plpgsql functions are stored as s

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Mikheev, Vadim wrote: > > > Why is it possible in Oracle' world? -:) > > > > Because of there limited features? > > And now we limit our additional advanced features -:) > > > Think about a language like PL/Tcl. At the time you call a > > script for execution, you cannot even be sur

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Alex Pilosov wrote: > 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 outfu

RE: [HACKERS] Rule recompilation

2001-07-12 Thread Mikheev, Vadim
> > Why is it possible in Oracle' world? -:) > > Because of there limited features? And now we limit our additional advanced features -:) > Think about a language like PL/Tcl. At the time you call a > script for execution, you cannot even be sure that the Tcl > bytecode c

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
On Thu, 12 Jul 2001, Jan Wieck wrote: > Mikheev, Vadim wrote: > > > > In good world rules (PL functions etc) should be automatically > > > > marked as dirty (ie recompilation required) whenever referenced > > > > objects are changed. > > > > > > Yepp, and it'd be possible for rules (just n

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Alex Pilosov
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 tr

RE: [HACKERS] Rule recompilation

2001-07-12 Thread Mikheev, Vadim
> > In good world rules (PL functions etc) should be automatically > > marked as dirty (ie recompilation required) whenever referenced > > objects are changed. > > Yepp, and it'd be possible for rules (just not right now). > But we're not in a really good world, so it'll not be

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Mikheev, Vadim wrote: > > 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 rela

Re: [HACKERS] Rule recompilation

2001-07-12 Thread Jan Wieck
Mikheev, Vadim wrote: > > > In good world rules (PL functions etc) should be automatically > > > marked as dirty (ie recompilation required) whenever referenced > > > objects are changed. > > > > Yepp, and it'd be possible for rules (just not right now). > > But we're not in a really

RE: [HACKERS] Rule recompilation

2001-07-12 Thread Mikheev, Vadim
> 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. In good world rules (PL fun