Andrew Sullivan ajs at crankycanuck.ca
Wed May 16 12:21:36 PDT 2007
On Wed, May 16, 2007 at 01:48:04PM -0500, jason at buberel.org wrote:

> To quote from the documentation: This ID must be unique across all sets; 
> you cannot have two tables in the same cluster with the same ID.

Right, that's a requirement that table IDs be globally unique to the
cluster.

> Within a single cluster, a table can only be a member of one set.

Yes, this is true.  Interestingly, I don't find this easily in the
docs (I haven't looked carefully, but I'm surprised that it doesn't
leap out at me in the discussion of sets).  So my apologies for
suggesting you read the manual more carefully.

You can see this is true, however, by looking at the table definition
of _slonyschema.sl_table:

 \d _copy_test.sl_table
    Table "_copy_test.sl_table"
   Column    |  Type   | Modifiers 
-------------+---------+-----------
 tab_id      | integer | not null
 tab_reloid  | oid     | not null
 tab_relname | name    | not null
 tab_nspname | name    | not null
 tab_set     | integer | 
 tab_idxname | name    | not null
 tab_altered | boolean | not null
 tab_comment | text    | 
Indexes:
    "sl_table-pkey" primary key, btree (tab_id)
    "sl_table_tab_reloid_key" unique, btree (tab_reloid)
Foreign-key constraints:
    "tab_set-set_id-ref" FOREIGN KEY (tab_set) REFERENCES
_copy_test.sl_set(set_id)

As you can see, tab_reloid (which is the oid from pg_class for the
table) is unique, and there's only room for one tab_set value.  So
each table must be in exactly one set.

A

-- 
Andrew Sullivan  | ajs at crankycanuck.ca
The whole tendency of modern prose is away from concreteness.
		--George Orwell


More information about the Slony1-general mailing list