Re: [PG95-DEV] Rule system

Started by Bruce Momjianover 27 years ago4 messages
#1Bruce Momjian
maillist@candle.pha.pa.us

The simple way is to reduce the capabilities of the Postgres
rule system. Changing the syntax of the CREATE RULE to

CREATE RULE rule AS { BEFORE | AFTER } event TO table
DO [ INSTEAD ] { action | NOTHING }

would tell the rewrite handler, if the rule actions have to
be applied before or after the query. Respectively only NEW
or CURRENT could be referenced in the rules qualification and
actions. I don't like this simple way, but I think it's the
only possibility that would work without reincarnating the
instance rule system.

Good description of the problem. If adding BEFORE/AFTER makes it easier
to program, do it. I don't think we are losing any functionality by
doing this, and the rule system is advertized as being broken, so there
is probably not a huge installed base.

We now have something that doesn't work. If you can get it working, do
it. The change makes it clearer to the user exactly how the rule is
going to behave, too.

Jan, I remember you steering away from rewrite cleanups because we were
so close to 6.3. Any chance you can make those changes for 6.4, or are
you already working on them? We really need cleanup in the rewrite
area, and I understand you can do it.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#2Noname
jwieck@debis.com
In reply to: Bruce Momjian (#1)

The simple way is to reduce the capabilities of the Postgres
rule system. Changing the syntax of the CREATE RULE to

CREATE RULE rule AS { BEFORE | AFTER } event TO table
DO [ INSTEAD ] { action | NOTHING }

would tell the rewrite handler, if the rule actions have to
be applied before or after the query. Respectively only NEW
or CURRENT could be referenced in the rules qualification and
actions. I don't like this simple way, but I think it's the
only possibility that would work without reincarnating the
instance rule system.

Good description of the problem. If adding BEFORE/AFTER makes it easier
to program, do it. I don't think we are losing any functionality by
doing this, and the rule system is advertized as being broken, so there
is probably not a huge installed base.

We now have something that doesn't work. If you can get it working, do
it. The change makes it clearer to the user exactly how the rule is
going to behave, too.

Jan, I remember you steering away from rewrite cleanups because we were
so close to 6.3. Any chance you can make those changes for 6.4, or are
you already working on them? We really need cleanup in the rewrite
area, and I understand you can do it.

I hoped to get pl/pgsql finished before 6.4, but since I got
some private trouble and much serious work, I fear to miss
that target too. Haven't had my fingers on PostgreSQL at all
for the last weeks.

But you're right, the rewrite handler still needs work and
since I spent much time to understand the code it would be
wasted time if someone else has to do it.

Let's see if I find some time sometimes :-)

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
+  If your life is a hard drive,     |  (610) 353-9879(w)
+  Christ can be your backup.        |  (610) 853-3000(h)

Until later, 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) #

#3Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Noname (#2)
Re: [HACKERS] Re: [PG95-DEV] Rule system

I hoped to get pl/pgsql finished before 6.4, but since I got
some private trouble and much serious work, I fear to miss
that target too. Haven't had my fingers on PostgreSQL at all
for the last weeks.

But you're right, the rewrite handler still needs work and
since I spent much time to understand the code it would be
wasted time if someone else has to do it.

Let's see if I find some time sometimes :-)

That would be good. The pl/pgsql would be nice, but the rewrite system
is more significant to users right now.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#4Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Noname (#2)

The simple way is to reduce the capabilities of the Postgres
rule system. Changing the syntax of the CREATE RULE to

CREATE RULE rule AS { BEFORE | AFTER } event TO table
DO [ INSTEAD ] { action | NOTHING }

would tell the rewrite handler, if the rule actions have to
be applied before or after the query. Respectively only NEW
or CURRENT could be referenced in the rules qualification and
actions. I don't like this simple way, but I think it's the
only possibility that would work without reincarnating the
instance rule system.

Good description of the problem. If adding BEFORE/AFTER makes it easier
to program, do it. I don't think we are losing any functionality by
doing this, and the rule system is advertized as being broken, so there
is probably not a huge installed base.

We now have something that doesn't work. If you can get it working, do
it. The change makes it clearer to the user exactly how the rule is
going to behave, too.

Jan, I remember you steering away from rewrite cleanups because we were
so close to 6.3. Any chance you can make those changes for 6.4, or are
you already working on them? We really need cleanup in the rewrite
area, and I understand you can do it.

I hoped to get pl/pgsql finished before 6.4, but since I got
some private trouble and much serious work, I fear to miss
that target too. Haven't had my fingers on PostgreSQL at all
for the last weeks.

But you're right, the rewrite handler still needs work and
since I spent much time to understand the code it would be
wasted time if someone else has to do it.

Let's see if I find some time sometimes :-)

Just curious if you have had any time to look into cleaning up the
rewrite system for 6.4?

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)