Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-16 Thread Robert Haas
On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: In bug #6734 we have a complaint about a longstanding misfeature of CREATE TABLE LIKE. Ordinarily, this command doesn't select names for copied indexes, but leaves that to be done at runtime by DefineIndex. But if it's

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-16 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I suggested that we could dodge the problem by allowing IndexStmt to carry a comment to be attached to the new index, and thereby avoid needing an explicit COMMENT command. Attached

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-16 Thread Robert Haas
On Mon, Jul 16, 2012 at 12:43 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I suggested that we could dodge the problem by allowing IndexStmt to carry a comment to be attached to the new

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-16 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: The problem isn't confined to CREATE TABLE LIKE; it's a widespread design flaw that will likely take years of work to clean up completely. I don't think that's a reason not to commit your change though; it fixes a bug and is an incremental

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-16 Thread Robert Haas
On Mon, Jul 16, 2012 at 1:10 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: The problem isn't confined to CREATE TABLE LIKE; it's a widespread design flaw that will likely take years of work to clean up completely. I don't think that's a reason not to commit

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-15 Thread Gurjeet Singh
On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: While I was at it, it seemed like DefineIndex's parameter list had grown well past any sane bound, so I refactored it to pass the IndexStmt struct as-is rather than passing all the fields individually. With or without that

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-15 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I would like to sneak this fix into 9.2, though. Does anyone think it's already too late to be touching these APIs for 9.2? I'd like us to stick to the standard practice of not

Re: [HACKERS] Getting rid of pre-assignment of index names in CREATE TABLE LIKE

2012-07-15 Thread Gurjeet Singh
On Sun, Jul 15, 2012 at 11:49 AM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: On Sat, Jul 14, 2012 at 4:02 PM, Tom Lane t...@sss.pgh.pa.us wrote: I would like to sneak this fix into 9.2, though. Does anyone think it's already too late to be touching