summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
Diffstat (limited to 'database')
-rw-r--r--database/database.pgsql4
-rw-r--r--database/updates.inc16
2 files changed, 17 insertions, 3 deletions
diff --git a/database/database.pgsql b/database/database.pgsql
index c2449b591..4729a99eb 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -378,9 +378,9 @@ CREATE TABLE locales_target (
translation text DEFAULT '' NOT NULL,
locale varchar(12) NOT NULL default '',
plid int4 NOT NULL default '0',
- plural int4 NOT NULL default '0',
- UNIQUE (lid)
+ plural int4 NOT NULL default '0'
);
+CREATE INDEX locales_target_lid_idx ON locales_target(lid);
CREATE INDEX locales_target_locale_idx ON locales_target(locale);
CREATE INDEX locales_target_plid_idx ON locales_target(plid);
CREATE INDEX locales_target_plural_idx ON locales_target(plural);
diff --git a/database/updates.inc b/database/updates.inc
index a854e97ce..e6c1874aa 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1218,7 +1218,7 @@ function system_update_159() {
case 'mysql':
$ret[] = update_sql("UPDATE {sequences} SET id = $vid WHERE name = '{node_revisions}_vid'");
break;
-
+
case 'pgsql':
$ret[] = update_sql("SELECT setval('{node_revisions}_vid_seq', $vid)");
break;
@@ -1993,3 +1993,17 @@ function system_update_181() {
}
return $ret;
}
+
+/**
+ * The lid field in pgSQL should not be UNIQUE, but an INDEX.
+ */
+function system_update_182() {
+ $ret = array();
+
+ if ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql('ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_lid_idx');
+ $ret[] = update_sql('CREATE INDEX {locales_target}_lid_idx ON {locales_target} (lid)');
+ }
+
+ return $ret;
+}