Fix rewrite code so that rules are in fact executed in order by name,
Tom Lane <tgl@sss.pgh.pa.us>
Fix rewrite code so that rules are in fact executed in order by name, rather than being reordered according to INSTEAD attribute for implementation convenience. Also, increase compiled-in recursion depth limit from 10 to 100 rewrite cycles. 10 seems pretty marginal for situations where multiple rules exist for the same query. There was a complaint about this recently, so I'm going to bump it up. (Perhaps we should make the limit a GUC parameter, but that's too close to being a new feature to do in beta.)
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/rules.sgml | modified | +3 −3 |
| src/backend/rewrite/rewriteHandler.c | modified | +82 −122 |
| src/test/regress/expected/rules.out | modified | +17 −14 |
| src/test/regress/sql/rules.sql | modified | +7 −4 |