Skip site navigation (1) Skip section navigation (2)

Re: Patch to add a primary key using an existing index

From: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
To: Steve Singer <ssinger_pg(at)sympatico(dot)ca>
Cc: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to add a primary key using an existing index
Date: 2010-11-25 20:58:40
Message-ID: 4CEECE00.5000900@ca.afilias.info (view raw or flat)
Thread:
Lists: pgsql-hackers
On 10-11-22 03:24 PM, Steve Singer wrote:
> On 10-11-22 09:37 AM, Gurjeet Singh wrote:
>> On Sat, Nov 20, 2010 at 9:00 AM, Steve Singer <ssinger_pg(at)sympatico(dot)ca

> Almost fixed.
> I still get an unexpected difference.
>
> ! DETAIL: cannot create PRIMARY KEY/UNIQUE constraint with a non-unique
> index.
> CREATE UNIQUE INDEX rpi_idx2 ON rpi_test(a , b);
> -- should fail; WITH INDEX option specified more than once.
> ALTER TABLE rpi_test ADD PRIMARY KEY (a, b)
> --- 35,41 ----
> -- should fail; non-unique
> ALTER TABLE rpi_test ADD primary key(a, b) WITH (INDEX = 'rpi_idx1');
> ERROR: "rpi_idx1" is not a unique index
> ! DETAIL: Cannot create PRIMARY KEY/UNIQUE constraint using a non-unique
> index.

The attached version of the patch gets your regression tests to pass.

I'm going to mark this as ready for a committer.





Attachment: replace_pkey_index.revised2.patch.gz
Description: application/x-gzip (8.0 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Maciek SakrejdaDate: 2010-11-25 20:59:53
Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements
Previous:From: Radosław SmoguraDate: 2010-11-25 20:46:47
Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group