Bugs item #2795764, was opened at 2009-05-23 11:26
Message generated for change (Tracker Item Submitted) made by soster
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: Open
Resolution: None
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'];
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2795764&group_id=191583
|