Jan Wieck JanWieck
Tue May 30 10:19:06 PDT 2006
On 5/30/2006 11:54 AM, Matthew Whittaker-Williams wrote:

> On Tuesday 30 May 2006 17:01, Jan Wieck wrote:
>> On 5/30/2006 7:14 AM, Matthew Whittaker-Williams wrote:
>> > On Tuesday 30 May 2006 13:11, Matthew Whittaker-Williams wrote:
>> >> 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');
>> >
>> > Whoops..
>> >
>> > Should be this:
>> >
>> >  set add table ( set id = 1, origin = 1, id = 54, full qualified name
>> > = 'public,foo_map', key = 'foo1,foo2', comment = 'Table foo_map');
>>
>> Since the key used for Slony-I must be unique and not-null, specifying
>> multiple keys is totally pointless.
> 
> Yea I totally agree..
>>
>> Are you eventually mixing up multi-column keys with multiple keys? You
>> don't specify the column names but rather the index name in the SET ADD
>> TABLE command. If that happens to be a unique index over multiple
>> not-null columns, no problem.
>>
> Nah, these are primary keys for tables, it astonishes me too that they made it 
> this way.
> They also lack the use of UNIQUE keys or either by the new function SERIAL for 
> auto increment.

There can be only one primary key defined on any table (unless they have 
found a Postgres bug or tampered with the system catalog directly). Of 
course, a serial column doesn't imply UNIQUE, but can certainly be made so.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #



More information about the Slony1-general mailing list