dbTalk Databases Forums  

Re: [BUGS] BUG #6734: create table (like ...) fails if an indexhas a comment

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #6734: create table (like ...) fails if an indexhas a comment in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ryan Kelly
 
Posts: n/a

Default Re: [BUGS] BUG #6734: create table (like ...) fails if an indexhas a comment - 07-13-2012 , 08:24 AM






On Fri, Jul 13, 2012 at 12:00:14PM +0000, daniele.varrazzo (AT) gmail (DOT) com wrote:
Quote:
The following bug has been logged on the website:

Bug reference: 6734
Logged by: Daniele Varrazzo
Email address: daniele.varrazzo (AT) gmail (DOT) com
PostgreSQL version: 9.1.4
Operating system: Linux
Description:

Weird, isn't it? Test case below.

Dropping the comment, the create table command works as expected. The
command fails with an: "ERROR: relation "foo2_f1_idx" already exists".
The comments on chooseIndexName in src/backend/parser/parse_utilcmd.c say:

* XXX this is inherently broken because the indexes aren't created
* immediately, so we fail to resolve conflicts when the same name is
* derived for multiple indexes.

Which looks like the case here. So it seems like
chooseIndexName/ChooseIndexName might need to take a list of any indexes
names that have already been created to avoid this.

Quote:
begin;

CREATE TABLE foo
(
id serial primary key,
f1 integer NOT NULL
);


CREATE INDEX foo_idx1 ON foo (f1);

CREATE INDEX foo_idx2 ON foo (f1) WHERE id > 10;

COMMENT ON INDEX foo_idx2 IS 'whatever';

create table foo2 (like foo including all);

rollback;



--
Sent via pgsql-bugs mailing list (pgsql-bugs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
-Ryan Kelly

--
Sent via pgsql-bugs mailing list (pgsql-bugs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.