Alon Bar-Lev has uploaded a new change for review. Change subject: db: remove drop_old_uuid_functions ......................................................................
db: remove drop_old_uuid_functions no need for this since 3.3, only function that uses postgres user. Change-Id: I8c6f128785fb63f275587aec74e51c266c20931e Signed-off-by: Alon Bar-Lev <[email protected]> --- M packaging/dbscripts/create_schema.sh M packaging/dbscripts/dbfunctions.sh D packaging/dbscripts/drop_old_uuid_functions.sql 3 files changed, 0 insertions(+), 41 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/80/24880/1 diff --git a/packaging/dbscripts/create_schema.sh b/packaging/dbscripts/create_schema.sh index 6bf4d4c..8ca544e 100755 --- a/packaging/dbscripts/create_schema.sh +++ b/packaging/dbscripts/create_schema.sh @@ -56,7 +56,6 @@ execute_file "create_tables.sql" "${DATABASE}" "${SERVERNAME}" "${PORT}" > /dev/null echo "Creating functions..." -drop_old_uuid_functions execute_file "create_functions.sql" "${DATABASE}" "${SERVERNAME}" "${PORT}" > /dev/null echo "Creating common functions..." diff --git a/packaging/dbscripts/dbfunctions.sh b/packaging/dbscripts/dbfunctions.sh index fd85f3d..336b965 100644 --- a/packaging/dbscripts/dbfunctions.sh +++ b/packaging/dbscripts/dbfunctions.sh @@ -109,19 +109,6 @@ rm -f drop_all_views.sql } -drop_old_uuid_functions() { - # - # dropping the uuid extension and old functions is - # required only if we upgrade from old database - # as it requires special privileges, so - # before execution check if actually required - # - local CMD="select count(*) from pg_proc where proname = 'uuid_nil';" - if [ "$(execute_command "$CMD" "${DATABASE}" "${SERVERNAME}" "${PORT}" | sed -e 's/ //g' -e '/^$/d')" != 0 ]; then - su postgres -c "psql -f drop_old_uuid_functions.sql '${DATABASE}'" > /dev/null - fi -} - #drops sps before upgrade or refresh operations drop_sps() { # common stored procedures are executed first (for new added functions to be valid) @@ -139,7 +126,6 @@ execute_file "${drop_all_functions}" ${DATABASE} ${SERVERNAME} ${PORT} > /dev/null ) || exit $? - drop_old_uuid_functions # recreate generic functions execute_file "create_functions.sql" ${DATABASE} ${SERVERNAME} ${PORT} > /dev/null } diff --git a/packaging/dbscripts/drop_old_uuid_functions.sql b/packaging/dbscripts/drop_old_uuid_functions.sql deleted file mode 100644 index 1859187..0000000 --- a/packaging/dbscripts/drop_old_uuid_functions.sql +++ /dev/null @@ -1,26 +0,0 @@ -create function __temp_drop_old_uuid_functions() -RETURNS void -as $procedure$ -begin - -- removing first the extension from pg9.x installations - if exists (select 1 from information_schema.views where table_name = 'pg_available_extensions') then - -- The - is special character , so need to put -- in the name - EXECUTE 'DROP EXTENSION IF EXISTS "uuid-ossp" CASCADE;'; - end if; - - --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); -end; $procedure$ -LANGUAGE plpgsql; - -select __temp_drop_old_uuid_functions(); -drop function __temp_drop_old_uuid_functions(); -- To view, visit http://gerrit.ovirt.org/24880 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c6f128785fb63f275587aec74e51c266c20931e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
