diff --git a/postgres-appliance/scripts/post_init.sh b/postgres-appliance/scripts/post_init.sh index 4c9d863a..3b03ca34 100755 --- a/postgres-appliance/scripts/post_init.sh +++ b/postgres-appliance/scripts/post_init.sh @@ -157,7 +157,8 @@ BEGIN THEN 'FOREIGN TABLE' ELSE 'VIEW' END INTO obj_type FROM pg_class - WHERE oid = 'public.postgres_log_${i}'::regclass; + WHERE relname = 'postgres_log_${i}' + AND relnamespace = 'public'::pg_catalog.regnamespace; EXECUTE format('DROP %s IF EXISTS public.postgres_log_${i} CASCADE', obj_type); END;\$\$;" diff --git a/postgres-appliance/tests/test_spilo.sh b/postgres-appliance/tests/test_spilo.sh index d84bdc4a..360ef132 100755 --- a/postgres-appliance/tests/test_spilo.sh +++ b/postgres-appliance/tests/test_spilo.sh @@ -262,7 +262,7 @@ function verify_hourly_log_rotation() { postgres_log_views=$(docker_exec "$1" "psql -U postgres -tAc \"SELECT count(*) FROM pg_views WHERE viewname LIKE 'postgres_log_%'\"") postgres_failed_auth_views=$(docker_exec "$1" "psql -U postgres -tAc \"SELECT count(*) FROM pg_views WHERE viewname LIKE 'failed_authentication_%'\"") - [ "$log_rotation_age" = "1h" ] && [ "$log_filename" = "postgresql-%u-%H.log" ] && [ "$postgres_log_ftables" -eq 192 ] && [ "$postgres_log_views" -eq 8 ] && [ "$postgres_failed_auth_views" -eq 200 ] + [ "$log_rotation_age" -eq "1h" ] && [ "$log_filename" -eq "postgresql-%u-%H.log" ] && [ "$postgres_log_ftables" -eq 192 ] && [ "$postgres_log_views" -eq 8 ] && [ "$postgres_failed_auth_views" -eq 200 ] } # TEST SUITE 1 - In-place major upgrade 12->13->...->16