From 3d38b57220a6302f34d31b332c1b680569493ab9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 16 May 2006 09:22:36 +0000 Subject: - Patch #41481 by Zen, Cvbge, sun et al: bugfix: duplicate key error while editing locale strings. --- database/updates.inc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'database/updates.inc') 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; +} -- cgit v1.2.3