From:
Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To:
Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc:
Steve Singer <ssinger_pg(at)sympatico(dot)ca>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: Patch to add a primary key using an existing index
Date:
2010-11-29 01:06:42
Message-ID:
AANLkTin04diTRki2iV9PHyKk_GHU0SSQ7-h5_OQBzS7u@mail.gmail.com (view raw or flat )
Thread:
2010-10-09 18:07:15 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-10-09 18:19:26 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-10-09 18:46:20 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2010-10-09 19:30:19 from Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
2010-10-09 20:54:47 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-10-29 07:53:24 from Matteo Beccati <php(at)beccati(dot)com>
2010-11-01 14:29:58 from Jim Nasby <jim(at)nasby(dot)net>
2010-11-07 17:39:08 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-11-07 18:54:44 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-11-20 01:00:46 from Steve Singer <ssinger_pg(at)sympatico(dot)ca>
2010-11-22 14:37:43 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-11-22 20:24:34 from Steve Singer <ssinger_pg(at)sympatico(dot)ca>
2010-11-25 20:58:40 from Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
2010-11-29 01:06:42 from Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
2010-11-29 01:40:08 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-11-29 06:58:40 from David Fetter <david(at)fetter(dot)org>
2010-12-03 19:23:51 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-12-03 19:43:18 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-12-03 19:45:59 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-12-03 19:58:07 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2010-12-03 20:04:01 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-12-03 19:56:15 from r t <pgsql(at)xzilla(dot)net>
2010-12-03 20:27:57 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-12-03 21:41:44 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-12-03 22:16:04 from Robert Treat <rob(at)xzilla(dot)net>
2010-12-03 23:10:08 from "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
2010-12-04 06:30:09 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-12-04 11:48:19 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-12-04 15:42:22 from Robert Treat <rob(at)xzilla(dot)net>
2010-12-04 16:46:39 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-12-04 20:37:43 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-12-04 22:13:42 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-12-04 00:11:12 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-12-05 19:09:31 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2010-12-09 18:09:44 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2010-12-09 19:48:48 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-12-09 19:51:58 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-12-09 20:59:29 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-01-06 21:28:19 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2011-01-16 22:34:14 from Steve Singer <ssinger_pg(at)sympatico(dot)ca>
2011-01-17 01:49:32 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-01-24 18:00:22 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-01-25 00:01:13 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-01-25 00:56:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-01-25 17:59:09 from Joshua Tolley <eggyknap(at)gmail(dot)com>
2011-01-25 20:01:40 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2011-01-25 20:31:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-01-25 20:38:12 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2011-01-25 21:14:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-01-26 13:01:37 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Lists:
pgsql-hackers
On Fri, Nov 26, 2010 at 05:58, Steve Singer <ssinger(at)ca(dot)afilias(dot)info> wrote:
> The attached version of the patch gets your regression tests to pass.
> I'm going to mark this as ready for a committer.
I think we need more discussions about the syntax:
ALTER TABLE table_name ADD PRIMARY KEY (...) WITH (INDEX='index_name')
Issues:
* WITH (...) is designed for storage parameters. I think treating "INDEX"
as a special keyword in the way might be confusable.
* 'index_name' needs to be single-quoted, but object identifiers should
be double-quoted literals in normal cases.
* The key specifier is a duplicated option because the index has own keys.
Do we need it? It might be for safety, but redundant.
Note that the patch raises a reasonable error on conflict:
ERROR: PRIMARY KEY/UNIQUE constraint definition does not match the index
And, I found a bug:
* USING INDEX TABLESPACE clause is silently ignored, even if the index
uses another tablespace.
After all, do we need a special syntax for the functionality?
Reusing WITH (...) syntax seems to be a trouble for me.
"ADD PRIMARY KEY USING index_name" might be a candidate, but we'd
better reserve USING for non-btree PRIMARY KEY/UNIQUE indexes.
Ideas and suggestions?
--
Itagaki Takahiro
In response to
Responses
pgsql-hackers by date
Next :From: Simon RiggsDate: 2010-11-29 01:14:23
Subject : Re: Assertion failure on hot standby
Previous :From : Tom LaneDate : 2010-11-29 01:01:35
Subject : Re: profiling connection overhead