A slonik command like EXECUTE SCRIPT( SET ID=1, FILENAME='/tmp/executeScript5718113975686807087.sql' , EVENT NODE=1, EXECUTE ONLY ON=5); Where the EVENT NODE != the EXECUTE ONLY ON node tries to execute the DDL against node 1 (the event node). This essentially ignores the node id specified in the ONLY ON syntax. We could either: 1) Submit the ddl script into the replication queue on the event node but only execute it on the ONLY ON node. 2) Change EXECUTE ONLY ON to be a boolean so when it is true we only execute on the EVENT NODE 3) Generate an error if event node != ONLY ON and let the user fix their script.
Or change the event node value after parsing with the execute only node (if given), emitting a warning.
(In reply to comment #0) > 3) Generate an error if event node != ONLY ON and let the user fix their > script. I favour this option, generally. There's also the nuance that when you do "EXECUTE ONLY ON," there isn't an event generated, so I'd think it a fine idea to require that EVENT NODE be left blank, in this case.
Created attachment 60 [details] Have DDL validate that not both EVENT NODE and ONLY ON NODE are set Here's a patch that validates that EVENT NODE and ONLY ON NODE are not both present.
Jan to review code.
Committed for release 2.0.5 http://git.postgresql.org/gitweb?p=slony1-engine.git;a=commit;h=c6de292bbb3fea189cece38d6bf5bf7c22a9fa92