[Bucardo-general] Multi-column PKey

Preston A. Elder prez at goth.net
Tue Aug 19 00:38:35 UTC 2008


This worked, however it's a REAL pain, considering it involves:

ALTER TABLE to add new combined key column with UNIQUE constraint
UPDATE table to set initial value of the combined key field
ALTER TABLE to make the combined key column not null
CREATE FUNCTION that will update combined key column
CREATE TRIGGER to use above function on update or insert

So 5 steps for EACH database to 'fake' a primary key.  PLEASE get
multi-column pkeys working soon ;P

I did not try the VIEW or custom SELECT option.

PreZ

On Mon, 2008-08-18 at 14:49 -0700, Adam Wendt wrote:
> On Mon, Aug 18, 2008 at 1:47 PM, Preston A. Elder <prez at goth.net>
> wrote:
> >  - An actual column that is UNIQUE NOT NULL and is updated by
> trigger
> > when the column is updated/inserted (the idea being that it is
> removed
> > when multi-column pkeys are supported)?
> 
> I believe this will work, should be something you can easily test.
> 
> Adam
> Adam Wendt Consulting
> 
> 




More information about the Bucardo-general mailing list