Matthew Whittaker-Williams m.whittaker-williams
Tue May 30 04:11:43 PDT 2006
Hi,

I was wondering if it is possible to define multiple primary keys in the set 
add table function.

Like so:

set add table ( set id = 1, origin = 1, id = 54, full qualified name 
= 'public,foo_map, key = 'foo1,foo2', comment = 'Table foo_map');

Table:
-----------
CREATE TABLE foo_map (
customer integer NOT NULL,
address integer NOT NULL
);

Primary key(s):
------------------------
ALTER TABLE ONLY foo_map
ADD CONSTRAINT foo_map_pkey PRIMARY KEY (foo1, 
foo2);

Table foo1/foo2:
--------------------------
CREATE TABLE foo1 (
id integer NOT NULL,
first_name character varying(255),
last_name character varying(50),
created_date timestamp without time zone,
modified_date timestamp without time zone,
enabled boolean
);

CREATE TABLE foo2 (
id integer NOT NULL,
address character varying(50),
created_date timestamp without time zone,
modified_date timestamp without time zone,
enabled boolean
);

Don`t ask my why I need this because it isn`t my database design.
Personally I see no use in multiple primary keys defined for one table.

Well let me know

Thanks in advance

With kind regards

Matthew Whittaker-Williams
-- 
Unix system & Network Engineer
Internet Unie Services B.V.
Postbus 23667
1100 ED  AMSTERDAM
Tel: +31(0)20 463 0506
Fax: +31(0)20 463 2146
Email: m.whittaker-williams at iu.nl
URL: http://iu.nl
PGP: 0x08A909D0
Ripe nic-handle: MW2861-RIPE



More information about the Slony1-general mailing list