Rules: first fix
Rules: first fix
От:
jwieck@debis.com (Jan Wieck)
Дата:
Hi,
as proposed here comes the first patch for the query rewrite
system.
The tar archive contains mainly a little test suite that
would fit into our regression tests. You'll find the patch
itself (src.diff) in the directory ./ruletest.
Changes:
The syntax of CREATE RULE now accepts () in addition to
[] to group the action statements. I looked around to
see, what ANSI says on CREATE RULE with no luck. But I
found what other database systems expect:
Sybase, Microsoft SQL Server and some others use
CREATE RULE to add value checking on table columns.
But Sybase says for ANSI compliance the check clause
on CREATE TABLE should be used.
Ingres uses CREATE RULE where PostgreSQL uses CREATE
TRIGGER (and it uses ... EXECUTE PROCEDURE
proname(args) too on it).
AMOS uses ... DO proname(args), so I assume this
means trigger like in Ingres.
INSTEAD NOTHING rules now create an action. It is a new
query command type CMD_NOTHING that is treated in the
rewrite handler as a null statement (thrown away). This
allows now event qualification on instead nothing rules
(formerly not supported).
Queries that are fired in by the rule system are now
executed before the original query (if it still exists
after rewriting). This is required because a constraint
delete query fired in by a delete rule would become a
mergejoin (or the like) that does a scan on the triggered
relation, but in the case of a delete it cannot find the
deleted tuples if the delete takes place first. The same
would happen if an update modifies the key fields. This
might interfere with table constraints or triggers that
check for foreign keys. It could be a situation where
only a real trigger can help (Bruce, did you receive
PL/pgSQL?).
Major change is that relation level rules seem to work
now (as far as I tested them). I was able to create
insert/update/delete rules on a view that do the required
actions on the tables behind it. Constraint
update/delete rules work. Instead rules with
qualification can be used to distribute insertion into
different tables (user inserts every time into the same
table but tuples are really inserted into different
and/or multiple tables depending on qualifications).
Left to do:
Create more tests.
There are still problems (don't know how to copy
object...) when using a rule after creation without
starting a new backend. This must get fixed.
Create more tests.
I haven't had a look on attribute level rules.
Create more tests.
I still must look at the update new stuff. I don't know
what it currently does at all, but I know what it must
do. It must modify (or extend) the actual parsetree's
targetlist entries putting in the rule actions target
list expressions.
Create more tests.
Last but not least: create much more tests (would someone
be so kind to assist?)
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this r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_GFU6![Y[1BAJ_M&V%R32SWP7"L8KUYG^0??^+>!
MN*]U!)H%M^JMC=NUK7':/R"6]N(>2N7'?*-+"EK(&SP.A:0G'9\*%/Q6YV6I
M2'X25!T[#^UX>_V)G[_,5=Y)`A//X_"P'QT>CK?+H^D`!-9PXMV;Z??[T:#O
M%X(@;GJ_V^IKR<8Z'+641YY$]OJXJQ+:YG^'<8EXE;;E;KRKC)2<42^\F>O'
MO$FMO\*(U%\7\#)*1LM&`"`IG3?%`(9YQNI#Z?HQD;29Y^*#WA+E7(SN)LR<+$2
M,!D=L/-R9(B^WA[E6C^LO)]AN4)>64RK.RR'<9&4]',Z6].)X#5/34SA\*`+
M,-3)@(MX%G4!Q9B5L4K_3J;#F+72A#M81$EH+]@'ZX&:!W2-+7^SY]XH^'5A,^G#@;-FQ;R48>]QH;;4:%/9>FM+6!O?VJ5>
M$#]YV3\("^+;P;Q;5X/)R^'!R_X]5?#[_7&T[V*_'9?CB<@\X;H0O(B!ETQ-
ME^AF-=\(A>\(JR'8K^`H79Q&^O7-[Q=GO_V78J3>/6P=%#RADNP$*06*]/TF
M$3GGD5>G!H?[*9ZMUXO(I-5LEV?\8GY9B*M'YT1[PHMQ\NU'+R9ZF-7T[!SV
MXB*,F:P7BXWES6MF8SM&[:I(T%;+H/MMK5OW^!J/!WC_D[R-Y@?,84;WOO\)
G/GUY_\<0WP!"[_\8#/YEQH_O_WC\/'X>/X^?'_;Y"ZF1A?@`\```
`
end
Re: [HACKERS] Rules: first fix
От:
The Hermit Hacker <scrappy@hub.org>
Дата:
On Mon, 17 Aug 1998, Jan Wieck wrote:
> Hi,
>
> as proposed here comes the first patch for the query rewrite
> system.
>
> The tar archive contains mainly a little test suite that
> would fit into our regression tests. You'll find the patch
> itself (src.diff) in the directory ./ruletest.
Applied...I'm a little confused though as to what in the ruletest
directory was suppose to be included, so I only included the
results/expected subdirectories. scripts didn't seem to "fit" anywhere in
the regression tests...let me know if I'm wrong :(
Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
Re: [HACKERS] Rules: first fix
От:
jwieck@debis.com (Jan Wieck)
Дата:
>
> On Mon, 17 Aug 1998, Jan Wieck wrote:
>
> > Hi,
> >
> > as proposed here comes the first patch for the query rewrite
> > system.
> >
> > The tar archive contains mainly a little test suite that
> > would fit into our regression tests. You'll find the patch
> > itself (src.diff) in the directory ./ruletest.
>
> Applied...I'm a little confused though as to what in the ruletest
> directory was suppose to be included, so I only included the
> results/expected subdirectories. scripts didn't seem to "fit" anywhere in
> the regression tests...let me know if I'm wrong :(
>
>
> Marc G. Fournier
Ooops - sorry. The files scripts/setup_ruletest.sql and
scripts/run_ruletest.sql must go into .../regression/sql.
And then these two must be added to .../regression/sql/tests.
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) #Re: [HACKERS] Rules: first fix
От:
The Hermit Hacker <scrappy@hub.org>
Дата:
On Tue, 18 Aug 1998, Jan Wieck wrote:
> >
> > On Mon, 17 Aug 1998, Jan Wieck wrote:
> >
> > > Hi,
> > >
> > > as proposed here comes the first patch for the query rewrite
> > > system.
> > >
> > > The tar archive contains mainly a little test suite that
> > > would fit into our regression tests. You'll find the patch
> > > itself (src.diff) in the directory ./ruletest.
> >
> > Applied...I'm a little confused though as to what in the ruletest
> > directory was suppose to be included, so I only included the
> > results/expected subdirectories. scripts didn't seem to "fit" anywhere in
> > the regression tests...let me know if I'm wrong :(
> >
> >
> > Marc G. Fournier
>
> Ooops - sorry. The files scripts/setup_ruletest.sql and
> scripts/run_ruletest.sql must go into .../regression/sql.
> And then these two must be added to .../regression/sql/tests.
Fixed... :)
Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
Re: [HACKERS] Rules: first fix
От:
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Дата:
> as proposed here comes the first patch for the query rewrite system.
Hi Jan. I'm having trouble with views on my Linux system. The symptom is
that there is a segfault as memory is getting free'd at the end of a
query. The pg_view, pg_rule, and pg_user tables are all inaccessible as
views, though the underlying query which defines the view does work.
Unfortunately, I don't have any insight into the view stuff, and the
segfault is happening after everything executes so is far away from
where the bad or replicated pointer must be. afaik the problem has been
present for a month or two (your rules patches were applied Aug 17, so
that might be when).
Do you have any suggestions on where to look? I assume that you do no
develop under Linux because other Linux boxes (Tatsuo's at least) show
the same symptoms. I'd like to clear this up (I know that you are
developing new patches for the rules system, but...) since we have at
least two separate problems in the backend now (views and apparently
indices) and we need to reduce the discrepencies between the various
platforms to make progress.
An additional clue might be that I can do
select viewname from pg_view;
but not
select description from pg_view;
or
select * from pg_view;
Actually, there are three views in the system after the initdb, and the
only queries which result in a segfault are ones involving the "text"
fields. Of course, two of the three views have only two columns, one of
which is a text field, but it is suspicious; I can see all of the other
columns in pg_user except the passwd field, for example. I'll keep
poking at it.
btw, compiling with assert checking enabled does not catch the problem.
Regards.
- Tom