Re: [HACKERS] [BUGS] BUG #3774: create table like including index doesn't update pg_constraints with primary key
Hi, The fundamental question though is should we allow primary, unique CONSTRAINTS which use the index mechanism just as an implementation to be created using the INCLUDING INDEXES mechanism. Yeah, this bizarreness was foreseen and agreed to back when we set up LIKE INCLUDING CONSTRAINTS the way it was defined (ie, copying only CHECK constraints and not other things called constraints). I was never very thrilled with that definition myself, but it's a bit too late to revisit it. Yeah this is all confusing. I believe we should remove the following TODO now that the above has been checked in: CREATE - Have WITH CONSTRAINTS also create constraint indexes http://archives.postgresql.org/pgsql-patches/2007-04/msg00149.php Regards, Nikhils -- EnterpriseDB http://www.enterprisedb.com
Re: [HACKERS] [BUGS] BUG #3774: create table like including index doesn't update pg_constraints with primary key
NikhilS [EMAIL PROTECTED] writes: This can be handled by setting index-isconstraint appropriately inside generateClonedIndexStmt(). Done. The fundamental question though is should we allow primary, unique CONSTRAINTS which use the index mechanism just as an implementation to be created using the INCLUDING INDEXES mechanism. Yeah, this bizarreness was foreseen and agreed to back when we set up LIKE INCLUDING CONSTRAINTS the way it was defined (ie, copying only CHECK constraints and not other things called constraints). I was never very thrilled with that definition myself, but it's a bit too late to revisit it. regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] [BUGS] BUG #3774: create table like including index doesn't update pg_constraints with primary key
Hi, The following bug has been logged online: Bug reference: 3774 Logged by: guillaume (ioguix) de Rorthais Email address: [EMAIL PROTECTED] PostgreSQL version: 8.3 beta3 Operating system: mac os x 10.4.10 Description:create table like including index doesn't update pg_constraints with primary key Details: When creating a table using the create table ... (like ... inluding indexes...) syntaxe, pg_catalog.pg_constraint is not updated with the PK constraints which actually is setted in pg_index. I'm not sure if this issue is actually a bug or if there a logic behind this, but as the primary key is a constraint, I would expect it to be setted in pg_constraint, shouldn't it ? This can be handled by setting index-isconstraint appropriately inside generateClonedIndexStmt(). The fundamental question though is should we allow primary, unique CONSTRAINTS which use the index mechanism just as an implementation to be created using the INCLUDING INDEXES mechanism. As per the discussion here: http://www.nabble.com/Re%3A-CREATE-TABLE-LIKE-INCLUDING-INDEXES-support-p10683716.html maybe we should not? In other words INCLUDING INDEXES should only create those indexes which do not have isconstraint set to TRUE. Comments? Regards, Nikhils -- EnterpriseDB http://www.enterprisedb.com