On Fri, Nov 26, 2010 at 05:58, Steve Singer <ssin...@ca.afilias.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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers