Re: [HACKERS] Problem with CREATE TABLE ... (LIKE ... INCLUDING INDEXES)

2015-06-14 Thread Thom Brown
On 14 June 2015 at 04:25, Michael Paquier michael.paqu...@gmail.com wrote: On Sun, Jun 14, 2015 at 11:38 AM, Thom Brown t...@linux.com wrote: As you can see, 3 indexes are missing, which happen to be ones that would duplicate the column definition of another index. Is this intentional? If

Re: [HACKERS] Problem with CREATE TABLE ... (LIKE ... INCLUDING INDEXES)

2015-06-14 Thread Tom Lane
Thom Brown t...@linux.com writes: The commit refers to duplicate index names, and only for UNIQUE indexes. This behaviour is beyond that. And how does it determine which index to copy? In my example, I placed an index in a different tablespace. That could be on a drive with very different

[HACKERS] Problem with CREATE TABLE ... (LIKE ... INCLUDING INDEXES)

2015-06-13 Thread Thom Brown
Hi all, I've noticed that LIKE tablename INCLUDING INDEXES skips any indexes that were duplicated. e.g. CREATE TABLE people (id int, alias text); CREATE INDEX idx_people_id_1 ON people (id); CREATE INDEX idx_people_id_2 ON people (id) WHERE id % 2 = 0; CREATE INDEX idx_people_alias_1 ON people

Re: [HACKERS] Problem with CREATE TABLE ... (LIKE ... INCLUDING INDEXES)

2015-06-13 Thread Michael Paquier
On Sun, Jun 14, 2015 at 11:38 AM, Thom Brown t...@linux.com wrote: As you can see, 3 indexes are missing, which happen to be ones that would duplicate the column definition of another index. Is this intentional? If so, shouldn't it be documented behaviour? Looking at the code