Slony-I REL_1_1_0 Documentation
Prev | Fast Backward |  | Fast Forward | Next

# TABLE ADD KEY

## Name

TABLE ADD KEY -- Add primary key for use by Slony-I for a table with no suitable key

## Synopsis

`TABLE ADD KEY (options);`

## Description

In the Slony-I replication system, every replicated table is required to have at least one `UNIQUE` constraint whose columns are declared `NOT NULL.` Any primary key satisfies this requirement.

As a last resort, this command can be used to add such an attribute to a table that does not have a primary key. Since this modification can have unwanted side effects, it is strongly recommended that users add a unique and not null attribute by other means.

`NODE ID = ival`

  Node ID of the set origin where the table will be added as a set member. (See SET ADD TABLE.)

`FULLY QUALIFIED NAME = 'string'`

  The full name of the table consisting of the schema and table name as the SQL expression `quote_ident(nspname) || '.' || quote_ident(relname)` would return it.

> Note: There is a limitation at present; you can create a PostgreSQL table with no columns, as with `create table real_short ();` . Slony-I will refuse to handle such a table. This isn't presently regarded as a serious limitation, as we can't see there being terribly much interest in replicating tables that contain no application data.

This uses schemadoctableaddkey( text ).

## Example

         TABLE ADD KEY ( NODE ID = 1,
         FULLY QUALIFIED NAME = 'public.history' );

Prev | Home | Next
DROP LISTEN | Up | CREATE SET