/usr/share/doc/slony1-2-doc/adminguide/stmtsetaddtable.html is in slony1-2-doc 2.2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>SLONIK SET ADD TABLE</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:slony1-general@lists.slony.info"><LINK
REL="HOME"
TITLE="Slony-I 2.2.3 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Configuration and Action commands"
HREF="cmds.html"><LINK
REL="PREVIOUS"
TITLE="SLONIK MERGE
SET"
HREF="stmtmergeset.html"><LINK
REL="NEXT"
TITLE="SLONIK SET ADD SEQUENCE"
HREF="stmtsetaddsequence.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2014-07-24T12:39:44"></HEAD
><BODY
CLASS="REFENTRY"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
><SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
> 2.2.3 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="stmtmergeset.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="stmtmergeset.html"
>Fast Backward</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="stmtsetaddsequence.html"
>Fast Forward</A
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="stmtsetaddsequence.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="STMTSETADDTABLE"
></A
>SLONIK SET ADD TABLE</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6992"
></A
><H2
>Name</H2
>SET ADD TABLE -- Add a table to a <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
>
replication set </DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN6996"
></A
><H2
>Synopsis</H2
><P
><TT
CLASS="COMMAND"
>SET ADD TABLE (options);</TT
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6999"
></A
><H2
>Description</H2
><P
> Add an existing user table to a replication set. The set
cannot currently be subscribed by any other node - that
functionality is supported by the <A
HREF="stmtmergeset.html"
>SLONIK MERGE
SET</A
>
command.
<P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="LITERAL"
> SET ID = ival </TT
></DT
><DD
><P
> ID of the set to which the table is to be added. </P
></DD
><DT
><TT
CLASS="LITERAL"
> ORIGIN = ival </TT
></DT
><DD
><P
> Origin node for the set. (Optional) </P
></DD
><DT
><TT
CLASS="LITERAL"
> ID = ival </TT
></DT
><DD
><P
> Unique ID of the table. These ID's are not
only used to uniquely identify the individual table within the
replication system. The numeric value of this ID also
determines the order in which the tables are locked in a <A
HREF="stmtlockset.html"
>SLONIK LOCK SET</A
> command for example. So
these numbers might represent any applicable table hierarchy
to make sure the <SPAN
CLASS="APPLICATION"
>slonik</SPAN
> command
scripts do not deadlock at any critical
moment. If this parameter is omitted then slonik will
check every node that it can connect to and find the
highest table id being used across all nodes.</P
><P
> This ID must be unique across all sets; you cannot
have two tables in the same cluster with the same
ID. </P
><P
> Note that <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
> generates an in-memory array
indicating all of the fully qualified table names; if you use
large table ID numbers, the sparsely-utilized array can lead
to substantial wastage of memory. Each potential table ID
consumes a pointer to a char, commonly costing 4 bytes per
table ID on 32 bit architectures, and 8 bytes per table ID on
64 bit architectures. </P
></DD
><DT
><TT
CLASS="LITERAL"
> FULLY QUALIFIED NAME = 'string' </TT
></DT
><DD
><P
> The full table name including the name of the schema.
This can be omitted if <TT
CLASS="LITERAL"
>TABLES</TT
> is specified instead
</P
></DD
><DT
><TT
CLASS="LITERAL"
> KEY = { 'string' | SERIAL }
</TT
></DT
><DD
><P
> <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>(Optional)</I
></SPAN
> The index name that covers the
unique and not null set of columns to be used as the row identifier
for replication purposes. Default
is to use the table's primary key. The index name is <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
> not </I
></SPAN
> fully qualified; you must omit the
namespace.</P
></DD
><DT
><TT
CLASS="LITERAL"
>TABLES = 'string' </TT
></DT
><DD
><P
>A POSIX regular expression that specifies the
list of tables that should be added. This regular expression
is evaluated by <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> against the list of fully qualified table
names on the set origin to find the tables that should be added.
If <TT
CLASS="LITERAL"
>TABLES</TT
> is omitted then <TT
CLASS="LITERAL"
> FULLY QUALIFIED NAME</TT
> must be specified.
</P
><DIV
CLASS="WARNING"
><P
></P
><TABLE
CLASS="WARNING"
BORDER="1"
WIDTH="90%"
><TR
><TD
ALIGN="CENTER"
><B
>Warning</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
> The <TT
CLASS="LITERAL"
>TABLES</TT
> option requires
that all the tables are in <SPAN
CLASS="QUOTE"
>"good form"</SPAN
> to be replicated
en masse. The request will fail, not configuring any tables
for replication, if it encounters any of the following
problems:
<P
></P
></P><UL
><LI
><P
> Each table must have a <TT
CLASS="LITERAL"
>PRIMARY
KEY</TT
> defined, and a candidate primary key will not
suffice.</P
></LI
><LI
><P
> If a table is found that is already
replicated, the request will fail.</P
></LI
><LI
><P
> The <TT
CLASS="LITERAL"
>TABLES</TT
> option needs
to automatically assign table ID values, and looks through
the configuration on every node specified by <A
HREF="admconninfo.html"
>SLONIK ADMIN CONNINFO</A
>, finding the largest ID in use, and
starting after that for the table IDs that it
assigns.</P
><P
> It considers it a <SPAN
CLASS="QUOTE"
>"benign"</SPAN
> failure to
find a node that does not yet have a <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
> schema
assigned, as that may be expected to occur if tables are
configured before all the nodes have been configured using
<A
HREF="stmtstorenode.html"
>SLONIK STORE NODE</A
>. If there is no <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
>
schema, then that node certainly hasn't contributed
anything to an increase in the table IDs in use.</P
><P
> On the other hand, if a node specified by <A
HREF="admconninfo.html"
>SLONIK ADMIN CONNINFO</A
> is not available to be queried,
the request <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>will
fail.</I
></SPAN
></P
></LI
></UL
><P></P
></TD
></TR
></TABLE
></DIV
></DD
><DT
><TT
CLASS="LITERAL"
> COMMENT = 'string' </TT
></DT
><DD
><P
> A descriptive text added to the table entry. </P
></DD
><DT
><TT
CLASS="LITERAL"
>ADD SEQUENCES= boolean</TT
></DT
><DD
><P
>A boolean value that indicates if any sequences attached
to columns in this table should also be automatically
added to the replication set. This defaults to false</P
></DD
></DL
></DIV
><P>
</P
><P
> This uses <A
HREF="function.setaddtable-p-tab-comment-integer-p-tab-idxname-integer-p-fqname-text-p-tab-id-name-p-set-id-text.html"
>schemadocsetaddtable(p_tab_comment integer, p_tab_idxname integer, p_fqname text, p_tab_id name, p_set_id text)</A
>. </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7079"
></A
><H2
>Example</H2
><PRE
CLASS="PROGRAMLISTING"
>SET ADD TABLE (
SET ID = 1,
ORIGIN = 1,
ID = 20,
FULLY QUALIFIED NAME = 'public.tracker_ticket',
COMMENT = 'Support ticket',
ADD SEQUENCES=false
);
or
SET ADD TABLE (
SET ID=1,
TABLES='public\\.tracker*'
);
</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7082"
></A
><H2
> Error Messages </H2
><P
> Here are some of the error messages you may encounter if
adding tables incorrectly: </P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="LITERAL"
>Slony-I: setAddTable_int: table public.my_table PK column id nullable </TT
></DT
><DD
><P
> Primary keys (or candidates thereof) are
required to have all column defined as <TT
CLASS="COMMAND"
>NOT
NULL</TT
>. If you have a PK candidate that has columns
that are not thus restricted, <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
> will reject the table
with this message. </P
></DD
><DT
><TT
CLASS="LITERAL"
>Slony-I: setAddTable_int: table id 14 has already been assigned! </TT
></DT
><DD
><P
> The table id, stored in
<TT
CLASS="ENVAR"
>sl_table.tab_id</TT
>, is required to be unique
across all tables/nodes/sets. Apparently you have tried to
reused a table ID. </P
></DD
><DT
><TT
CLASS="LITERAL"
> Slony-I: setAddTable_int(): table public.my_table has no index mt_idx_14</TT
></DT
><DD
><P
> This will normally occur with candidate
primary keys; apparently the index specified is not available
on this node. </P
></DD
><DT
><TT
CLASS="LITERAL"
>Slony-I: setAddTable_int(): table public.my_table not found </TT
></DT
><DD
><P
> Worse than an index missing, the whole table
is missing. Apparently whatever process you were using to get
the schema into place everywhere didn't work properly. </P
></DD
><DT
><TT
CLASS="LITERAL"
> Slony-I: setAddTable_int(): public.my_view is not a regular table </TT
></DT
><DD
><P
> You can only replicate (at least, using
<TT
CLASS="COMMAND"
>SET ADD TABLE</TT
>) objects that are ordinary
tables. That doesn't include views or indexes. (Indexes can
come along for the ride, but you don't ask to replicate an
index...) </P
></DD
><DT
><TT
CLASS="LITERAL"
> Slony-I: setAddTable_int(): set 4 not found </TT
></DT
><DD
><P
> You need to define a replication set before
assigning tables to it. </P
></DD
><DT
><TT
CLASS="LITERAL"
> Slony-I: setAddTable(): set 4 has remote origin </TT
></DT
><DD
><P
> This will occur if set 4 is configured with,
as origin, node 1, and then you submit a <TT
CLASS="COMMAND"
>SET ADD
TABLE</TT
> request involving that set to some other node
than node 1. This would be expected to occur if there was
some confusion in the <TT
CLASS="COMMAND"
>admin conninfo</TT
>
configuration in the slonik script preamble...</P
></DD
><DT
><TT
CLASS="LITERAL"
>Slony-I: cannot add table to currently subscribed set 1 </TT
></DT
><DD
><P
> <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
> does not support adding tables to
sets that are already participating in subscriptions.
Instead, you need to define a new replication set, and add any
new tables to <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>that</I
></SPAN
> set. You might then
use <A
HREF="stmtmergeset.html"
>SLONIK MERGE
SET</A
> to merge the new set into an
existing one, if that seems appropriate. </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7135"
></A
><H2
> Locking Behaviour </H2
><P
> On the origin node, this operation requires a brief
exclusive lock on the table in order to alter it to add
replication triggers. On subscriber nodes, corresponding locking
takes place at the time of the <TT
CLASS="COMMAND"
>SUBSCRIBE_SET</TT
>
event. </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7139"
></A
><H2
> Slonik Event Confirmation Behaviour </H2
><P
> Slonik waits for the command submitted to the previous
event node to be confirmed on the specified event node before
submitting this command.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7142"
></A
><H2
> Version Information </H2
><P
> This command was introduced in <SPAN
CLASS="PRODUCTNAME"
>Slony-I</SPAN
> 1.0 </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="stmtmergeset.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="stmtsetaddsequence.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SLONIK MERGE
SET</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cmds.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SLONIK SET ADD SEQUENCE</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|