Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tjibY-00CmBy-Be for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Feb 2025 17:38:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tjibW-009jDs-B1 for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Feb 2025 17:38:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tjiW0-009i4G-3C for pgsql-bugs@lists.postgresql.org; Sun, 16 Feb 2025 17:33:12 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tjiVy-0019li-0G for pgsql-bugs@lists.postgresql.org; Sun, 16 Feb 2025 17:33:11 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-38f24fc466aso2566232f8f.2 for ; Sun, 16 Feb 2025 09:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739727187; x=1740331987; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=JsTM01CEmagQdWp3IBIcLWOlTqOjRui0EExsWi+Em7Q=; b=eVhrqqBPk3lEol7ywXirnN/Oc5Xg06xfEESnF28thPp/HlEPwOkB+oU4vXEHAmLpII SzxzPpTleMHgbzGSuNxkJWspmhJQNbZIY4OT2FXIPCJVt3pELpgWWo0U04Rq5m7vKxEv V01xpTMiYoEX2gv4+7fmEDS56sAWTSTfj/x9xh+8y1GAiWzo8RJ+K7giecdHfkcHQUUy haEnD5ODX76hDvzj7Yo7QF96F+UP+olCkLdFMQW6ylS3USGV/mh2MzX5U6z6K0iTUypZ 7S3BOMGIzD16JJE9XuQhSEzcod2MlVxsxONlj6NGcfpm5PK8uCMBYjjzPdtFEGH7UUGM +/1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739727187; x=1740331987; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JsTM01CEmagQdWp3IBIcLWOlTqOjRui0EExsWi+Em7Q=; b=oeQJJjLXqMX2Kk9dY6I4iCT/fvILfFa4OsHFuwJlskP70okYUqojnhyk1WQKYy2He8 tkF0j+N9YbJoG8hA9hqf/G2gCzeDBzyXhCu6KRSpAPGd7imt/bZGJB8eDkzslPfQHR54 SEAQWJDUoHBHqYBuu19T8tzJ71cKHJHjvnp4BK6UhceYS7qPwlnWZ5gfkqgAjw5UumHx UwsGfXqp12+UGa74+kHVHnny65XpHwWELj1ogtG4qEb9TekEAzGrNRk2v7YQWzf44DNd v4/iwljA0jIdhlmYYDDj8DS2bcJtZr1ifDNPWhO39kfbp8e2yiGb/6Jy0mWxqqzei3Df gJwQ== X-Forwarded-Encrypted: i=1; AJvYcCVp+UYri+HG75fJ3GCLMy46L9BxDiPk06cRTQ7jYZECYQ6Tdg4qTbb9gjCTVmDHpJnOfwFu8v+5Ldno@lists.postgresql.org X-Gm-Message-State: AOJu0Yz8m/aUXfZV6RTYpNAeP6W+gm7eKzp8jAkCHJmt4cl8QM9IgU6t 8iMmFIinjJiMfTc+9nZFO2z9Lst2XAbvFBwwJY4CFoU9CE84JlTx58L3Zlf7 X-Gm-Gg: ASbGnctc0uTn2W4hR3DBd6cRj6VT7uNdEil+lmzeZVpll9FahV+ptzxgOTvICpF1899 YBtZabXoy2P1WPjVJ1G6k6fLO+JKj+LEYWQXa3oupyn1o1ZxFc7/QqupdhssRRAsC0E4at+2QEI 5frXGrp4lMWKqLo04zoDHs2KHkYuo2lNYtrT+jWsxDlaB/l1wxyE4A5ou/T9a5AWET5VwuBRfFC A16xSOg7NVyjtKK7XSR+dtSN1LLmGBb991hc1E42CDuIsjTFGxr8rlQKv47aAkN7QrNOx21sufv eLC/JbMwxDWhYCTEhx6cvdawA+0LIxk= X-Google-Smtp-Source: AGHT+IG/gzXmzp8jBJ/iNuFkEz/jCCvjnzOawM7Xv37wkgtv4/KrD/789NEFCe/UYiiFeFnOvEVsPw== X-Received: by 2002:a5d:59a7:0:b0:38d:dd8c:51db with SMTP id ffacd0b85a97d-38f34167c6emr7119494f8f.53.1739727187418; Sun, 16 Feb 2025 09:33:07 -0800 (PST) Received: from ?IPV6:2a01:e0a:adc:af00::cf35:de8? ([2a01:e0a:adc:af00::cf35:de8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258ccef7sm10299930f8f.31.2025.02.16.09.33.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Feb 2025 09:33:06 -0800 (PST) Message-ID: <03bf1dba-cb83-47cb-81b5-f091168e4772@gmail.com> Date: Sun, 16 Feb 2025 18:33:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18813: Materialized view creation regression when inlining recursive SQL function To: Laurenz Albe , pgsql-bugs@lists.postgresql.org References: <18813-d5dadfa976a8ee2e@postgresql.org> Content-Language: en-GB From: Olivier Jolly In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le 16/02/2025 à 17:24, Laurenz Albe a écrit : > On Sun, 2025-02-16 at 15:49 +0000, PG Bug reporting form wrote: >> I've encountered an error when creating a materialized view as I updated >> its body by introducing a recursive function. >> >> On postgreSQL 16, it works as expected: the materialized view is created and >> works as intended. >> Starting from posgreSQL 17.0, the materialized view created failed with the >> error message >> >> ERROR:  function jsonb_recursive_merge(jsonb, jsonb) does not exist >> LINE 9:                    ELSE jsonb_recursive_merge(va::jsonb, vb:... >>                                 ^ >> HINT:  No function matches the given name and argument types. You might need >> to add explicit type casts. >> CONTEXT:  SQL function "jsonb_recursive_merge" during inlining >> >> postgreSQL 17.3 also returns the same error. > That's not a bug, that's expected: > https://www.postgresql.org/docs/current/release-17.html#RELEASE-17-MIGRATION > > Change functions to use a safe search_path during maintenance operations (Jeff Davis) > > So that's actually a bug in your function definition. > Fix it by running > > ALTER FUNCTION ... SET search_path = schema_containing_function; > > Make sure that the schema does *not* have CREATE privileges for PUBLIC... > Many thanks for the fast on point answer. I had read this part of the release note, but did not think it would apply to functions defined in PUBLIC (as it was part of the default search_path) ALTER FUNCTION ... SET search_path = public; fixed my script in 17.x, indeed. Thanks a lot, sorry for not finding out by myself. Take care,   Olivier