Christopher Browne cbbrowne at ca.afilias.info
Thu Jul 12 09:40:18 PDT 2007
"Dmitry Koterov" <dmitry at koterov.ru> writes:
> CREATE INDEX aaa ON public.bbb USING btree ((-ccc), ddd);

It would be useful to simplify this by taking as many Slony-I
components *out* of the picture as possible.

There is a program in the build, src/parsestatements/test-scanner,
which takes the scanner used in Slony-I for splitting EXECUTE SCRIPT
requests into individual statements, and exposes it as a simple
program which you can use to process a script consisting of multiple
SQL requests.

The problem you had with CREATE RULE is nicely shown to be a bug in
the scanner if you pass that SQL through "test-scanner".

I have posted a fix to the scanner which addresses that problem; it is
not yet in any Slony-I release.  I suppose that what we need to do is
to check these various cases to see what is breaking.

For the three cases that you have outlined in the most recent email, I
can suggest workarounds:

1.  CREATE INDEX aaa ...

 - You can quite safely run this against each node without resorting
   to the use of EXECUTE SCRIPT.  Creating indices does not require
   using EXECUTE SCRIPT.

2.  CREATE RULE "position_get_last_id_on_insert" ...

 - If you remove the final semicolon inside the brackets, then the
   scanner used by EXECUTE SCRIPT will not cut it short.

3.  CREATE UNIQUE INDEX "i_dictionary_uni_abbr" ...

 - As with 1., you can quite safely run this against each node without
   needing to use EXECUTE SCRIPT.

I'll take a look at these queries a little later to see how they may
affect the scanner.
-- 
let name="cbbrowne" and tld="ca.afilias.info" in String.concat "@" [name;tld];;
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)


More information about the Slony1-general mailing list