[ postfixadmin-Bugs-2795764 ] index name versus table name collision on postgres
Brought to you by:
christian_boltz,
gingerdog
From: SourceForge.net <no...@so...> - 2009-06-08 20:18:35
|
Bugs item #2795764, was opened at 2009-05-23 09:26 Message generated for change (Settings changed) made by gingerdog You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2795764&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Database Group: SVN (please specify revision!) >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Andrea Soster (soster) Assigned to: Nobody/Anonymous (nobody) Summary: index name versus table name collision on postgres Initial Comment: When upgrading to DB version 655 (from SVN 664), postfixadmin will try to create an index named "alias_domain" on the table alias, for field domain: db_query_parsed(_add_index('alias', 'domain', 'domain')); this collides with the table named "alias_domain". we could add an "index_" prefix on postgres indexes: Index: upgrade.php =================================================================== --- upgrade.php (revision 664) +++ upgrade.php (working copy) @@ -229,7 +229,7 @@ if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) { return "ALTER TABLE $table ADD INDEX `$indexname` ( `$fieldlist` )"; } elseif($CONF['database_type'] == 'pgsql') { - $pgindexname = $table . "_" . $indexname; + $pgindexname = "index_" . $table . "_" . $indexname; return "CREATE INDEX $pgindexname ON $table($fieldlist);"; # Index names are unique with a DB for PostgreSQL } else { echo "Sorry, unsupported database type " . $conf['database_type']; ---------------------------------------------------------------------- Comment By: GingerDog (gingerdog) Date: 2009-06-08 20:16 Message: hi; thanks for the bug report;i believe this is fixedin svn - i hadn't seen this bug report, and instead appended _idx on the object name. ---------------------------------------------------------------------- Comment By: GingerDog (gingerdog) Date: 2009-06-08 20:16 Message: Thanks for the bug report; we believe this has been fixed in subversion. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2795764&group_id=191583 |