Home > Archive > Slony1 PostgreSQL Replication > January 2006 > Execute Script change - re bug #1513









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Execute Script change - re bug #1513
Christopher Browne

2006-01-26, 5:00 pm

Further to our discussion, I see a further complication for bug #1513,
immediately...

slonik submits DDL changes directly to the local node. (see ddlscript())

As a result, the proposed state machine that splits DDL into statements
needs to be attached to both slon *and slonik*.

In effect, slonik would operate something like...

slon_mkquery (&query, "setup_ddl();");
while (s = get_next_statement(&script)) { /* Invoke each statement
on the local node */
slon_appendquery(&query, " invoke_ddl_int('%s')
;", s);
}
slon_appendquery(&query, "finish_ddl(%s);", &script); /* Submit the
whole script to propagate to other nodes */

Which would parallel, in slon, something like...

else if (strcmp(event->ev_type, "DDL_SCRIPT") == 0)
{
int ddl_setid = (int)strtol(event->ev_data1,
NULL, 10);
char *ddl_script = event->ev_data2;
int ddl_only_on_node =
(int)strtol(event->ev_data3, NULL, 10);

slon_appendquery(&query, "setup_ddl_int();");
while (s = get_next_statement(&script)) { /* Invoke
each statement on the local node */
slon_appendquery(&query, " invoke_ddl_int('%s')
;", s);
}
slon_appendquery(&query, "finish_ddl_int();");

I am, of course, covering over all the complications of
get_next_statement()
:-).
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com