Eli Mesika has uploaded a new change for review.

Change subject: core:Can not upgrade from 3.1 to 3.2
......................................................................

core:Can not upgrade from 3.1 to 3.2

This patch fix a bug that resulted from commit
6891171a906f708b8751cc583faffc94590e7948

In the above commit we had removed the external UUId package dependency
and replaced the implementation with our implementation keeping the same
function name.
But since the old original function was installed with user postgres and
we are trying to replace it with another user (engine), we got a message
that we have no privileges to drop the old function:
ERROR:  must be owner of function uuid_generate_v1

This fix runs a cleanup script that removes all old installed UUID
functions using the user postgres.

Change-Id: Iefbd051b30917827dd5dcf357cfcb5a6934ff589
Signed-off-by: Eli Mesika <emes...@redhat.com>
Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=890324
Signed-off-by: Eli Mesika <emes...@redhat.com>
---
M backend/manager/dbscripts/dbfunctions.sh
A backend/manager/dbscripts/drop_old_uuid_functions.sql
2 files changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/90/10690/1

diff --git a/backend/manager/dbscripts/dbfunctions.sh 
b/backend/manager/dbscripts/dbfunctions.sh
index ffffda0..aff4cfa 100755
--- a/backend/manager/dbscripts/dbfunctions.sh
+++ b/backend/manager/dbscripts/dbfunctions.sh
@@ -86,6 +86,8 @@
     execute_command "$CMD"  ${DATABASE} ${SERVERNAME} ${PORT} > 
drop_all_functions.sql
     execute_file "drop_all_functions.sql" ${DATABASE} ${SERVERNAME} ${PORT} > 
/dev/null
     \rm -f drop_all_functions.sql
+    #drop old uuid functions
+    psql -U postgres -h ${SERVERNAME} -h ${SERVERNAME} -p ${PORT} -f 
drop_old_uuid_functions.sql ${DATABASE} > /dev/null
     # recreate generic functions
     execute_file "create_functions.sql" ${DATABASE} ${SERVERNAME} ${PORT} > 
/dev/null
 }
diff --git a/backend/manager/dbscripts/drop_old_uuid_functions.sql 
b/backend/manager/dbscripts/drop_old_uuid_functions.sql
new file mode 100644
index 0000000..970063c
--- /dev/null
+++ b/backend/manager/dbscripts/drop_old_uuid_functions.sql
@@ -0,0 +1,11 @@
+--Drops all old UUID functions since we have an internal implementation
+drop function if exists  uuid_nil();
+drop function if exists  uuid_ns_dns();
+drop function if exists  uuid_ns_url();
+drop function if exists  uuid_ns_oid();
+drop function if exists  uuid_ns_x500();
+drop function if exists  uuid_generate_v1();
+drop function if exists  uuid_generate_v1mc();
+drop function if exists  uuid_generate_v3(namespace uuid, name text);
+drop function if exists  uuid_generate_v4();
+drop function if exists  uuid_generate_v5(namespace uuid, name text);


--
To view, visit http://gerrit.ovirt.org/10690
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iefbd051b30917827dd5dcf357cfcb5a6934ff589
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to