Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

2016-12-20 Thread Adrian Klaver
On 12/20/2016 03:03 AM, Andreas Joseph Krogh wrote: På tirsdag 20. desember 2016 kl. 11:42:56, skrev Achilleas Mantzios mailto:ach...@matrix.gatewaynet.com>>: On 20/12/2016 12:27, Andreas Joseph Krogh wrote: På tirsdag 20. desember 2016 kl. 11:02:27, skrev Achilleas Mantzios mailto:

Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

2016-12-20 Thread Andreas Joseph Krogh
På tirsdag 20. desember 2016 kl. 11:42:56, skrev Achilleas Mantzios < ach...@matrix.gatewaynet.com >: On 20/12/2016 12:27, Andreas Joseph Krogh wrote: På tirsdag 20. desember 2016 kl. 11:02:27, skrev Achilleas Mantzios < ach...@matrix.gatewaynet.com

Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

2016-12-20 Thread Achilleas Mantzios
On 20/12/2016 12:27, Andreas Joseph Krogh wrote: På tirsdag 20. desember 2016 kl. 11:02:27, skrev Achilleas Mantzios mailto:ach...@matrix.gatewaynet.com>>: On 20/12/2016 11:43, Andreas Joseph Krogh wrote: [snip] BEGIN; ALTER TABLE person ADD CONSTRAINT person_pk PRIMARY KEY (e

Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

2016-12-20 Thread Andreas Joseph Krogh
På tirsdag 20. desember 2016 kl. 11:02:27, skrev Achilleas Mantzios < ach...@matrix.gatewaynet.com >: On 20/12/2016 11:43, Andreas Joseph Krogh wrote: [snip] BEGIN; ALTER TABLE person ADD CONSTRAINT person_pk PRIMARY KEY (entity_id); alter table person drop c

Re: [GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

2016-12-20 Thread Achilleas Mantzios
On 20/12/2016 11:43, Andreas Joseph Krogh wrote: Hi all. For historical reasons I have a table which at first had an "id"-column (the PK) and later got an "entity_id"-column (which is a UNIQUE CONSTRAINT). I'm now trying to get rid of the "id"-column and make the "entity_id"-column the new PK. T

[GENERAL] Replacing an existing unique constraint (not UNIQUE INDEX) with primary key

2016-12-20 Thread Andreas Joseph Krogh
Hi all.   For historical reasons I have a table which at first had an "id"-column (the PK) and later got an "entity_id"-column (which is a UNIQUE CONSTRAINT).   I'm now trying to get rid of the "id"-column and make the "entity_id"-column the new PK. The tricky part is that both of these columns a