From 83af8c5f293b953e412f634a894693feb7ab9419 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Sat, 21 Sep 2024 16:17:21 +0200 Subject: [PATCH] add NULL check --- postgres-appliance/scripts/post_init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postgres-appliance/scripts/post_init.sh b/postgres-appliance/scripts/post_init.sh index 3b03ca34..cba98b75 100755 --- a/postgres-appliance/scripts/post_init.sh +++ b/postgres-appliance/scripts/post_init.sh @@ -159,7 +159,9 @@ BEGIN FROM pg_class WHERE relname = 'postgres_log_${i}' AND relnamespace = 'public'::pg_catalog.regnamespace; - EXECUTE format('DROP %s IF EXISTS public.postgres_log_${i} CASCADE', obj_type); + IF obj_type IS NOT NULL THEN + EXECUTE format('DROP %s IF EXISTS public.postgres_log_${i} CASCADE', obj_type); + END IF; END;\$\$;" if [ "$LOG_SHIP_HOURLY" != "true" ]; then