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 1uvMdO-00CVkX-QZ for pgsql-bugs@arkaria.postgresql.org; Sun, 07 Sep 2025 21:09:15 +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 1uvMdL-000ane-Pj for pgsql-bugs@arkaria.postgresql.org; Sun, 07 Sep 2025 21:09:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uvMdL-000anW-GX for pgsql-bugs@lists.postgresql.org; Sun, 07 Sep 2025 21:09:11 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uvMdH-0015OL-31 for pgsql-bugs@lists.postgresql.org; Sun, 07 Sep 2025 21:09:10 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-b03fa5c5a89so539399466b.2 for ; Sun, 07 Sep 2025 14:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1757279348; x=1757884148; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=eT93TNVaPclrSFW9hMkJtp2gngEZS1QHa9AvWJ5+U5I=; b=WzbuhVLbruMxHwQMu0cMvg2ULk06UI37YhTRLXupD4L7pOZRB5zwHtWrLiciZzBoJ6 H8AIHplZXfLeTz99xO2yajds3hoK05l0lSIzO6RsINpbw4rv+jvf4W8G7e0pS8cTKRdV YKUQzHf+6NSL8hdEvqoHCOQlO7hhTuNtNOfLZTX1QytbioAvCoQXj+4hAerThygwQihF dSDBGpAAyal1OHb6ci7j2GPwci9dCoQhOS5Z/LjqUalrUXNHRjXvpBtXHE/k4IILvzPx BTFG1S2k02qSKYqb+mmct3/9eXRMMAhI3lg/fM7VPepwRirC37E4ovaAflcQlRUtyeZa aesg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757279348; x=1757884148; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eT93TNVaPclrSFW9hMkJtp2gngEZS1QHa9AvWJ5+U5I=; b=R7LmrhTkJa9++q5NUGtIDYtfrXMMVEORYX3WANrjGf27oQj+MJcB5F8azOASdto9yV vgUVwIaTlRpDZF5Fs/RyJk56xSdfubXvQjnv4yYLN3wcaYpNo9raHPnXDYBuEt6u9Qhq JtwWqxvz2kfVHgTLAunAJHVG9Zf2ilJ95boUdhvF7fC4Io17/FWSD9+kcOVkNSddv5n3 NTYJEKpEwLRnZC96r9uXjoUQl8mEKNXSTIziDcavRmh/piuGpzYvEe/F/9ahWtZKv09+ m3pnCCy997SICfT8NPMPLtS8H7bPJlKYK2duLoqQYIxegYGxH2YY/ff36mNVc2/1kpGt p50w== X-Forwarded-Encrypted: i=1; AJvYcCW0YDspM9WN2BU0qHCmof2NScdl0u9w4+XmQ5T1qW2aNTfjJZwnE7onoRBztDDxUvSd3XyS+rJAys/T@lists.postgresql.org X-Gm-Message-State: AOJu0YyCKVksiBSjF88DoPRL3D82JsxALYZDPq8aZvCIRg3Buzt/Uizw Wdkvc3jrkHXRiCdKjwTMZzSWAKavywZXaelfZrdsmgKo8IWEy2IHDZEbaEl3alKrtH0= X-Gm-Gg: ASbGnctOU5xAU1Rwgpz8gPhHjmrxzU8WMkd/B4KOiHjDWADMeP8EXDA/QEZfjGU7eY3 RncTmsee00r8fwEzElCms2rUVxZIuBAiHOd9kJkolj/q8uH9RfwTG5N7s87rF2sXaaqPjNveYh1 HY56syohBDFzz72qPggNSubkP6WhvZAL0OxGMW6qjwKaYIrPlf0/wVwI+mE3z6Z1WH7b5c8ZRjf 8zd0gWgA/0A7jWEump4meJhFb9P8GkxPPM6oDpexRQzpZt9Y8Y/vL3dC134VHwyC/dICPMunMvL BftrYzh33is9OKgROY0XT5jyZPM4foLohIHkFANv3CDQBSjmWGm0PN4C7kpP63prMQBANjDmyJV 2qcJyC27oNiRFks8Q/ACSNhbhmFRqglNWdIkCKYzmnWcKoNTZ8c7Q X-Google-Smtp-Source: AGHT+IGVcFqzz8eo3VrjgytDduo+cgWIx8hN4rmfA/qCypBlydYeDTiATSgnmN8vz4/v4s61dLjwEg== X-Received: by 2002:a17:907:1ca2:b0:afe:b5fa:2af2 with SMTP id a640c23a62f3a-b04b179c2b7mr502005566b.64.1757279347416; Sun, 07 Sep 2025 14:09:07 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:255:30a:2403:9037:2d08:c2c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aff173ddc78sm2152506166b.33.2025.09.07.14.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Sep 2025 14:09:07 -0700 (PDT) Message-ID: Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own From: Laurenz Albe To: "David G. Johnston" Cc: Tom Lane , Yushu Chen , "katja.henke@foo.ag" , "pgsql-bugs@lists.postgresql.org" Date: Sun, 07 Sep 2025 23:09:06 +0200 In-Reply-To: References: <19034-de0857b4f94ec10c@postgresql.org> <1030106.1756999498@sss.pgh.pa.us> <8dec121e2d3bfc1149d36359345fbce1faa087aa.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2025-09-05 at 05:55 -0700, David G. Johnston wrote: > > Sure, but creating a dump that will fail to load is not good. > > I don't have a smarter idea that dumping standard SQL functions > > in two statements like you suggested... >=20 > When resolving the dependency graph for such a function can we prevent th= e > oid of the parent and the oid of the child being the same value? > Prohibit direct self-references so it fails even if you use =E2=80=9Cor r= eplace=E2=80=9D. I am not sure I can follow. With "parent" and "child", do you mean the function as it was originally created and the function after replacing it with a recursive function? If yes, then that's not an option. The main point of CREATE OR REPLACE FUNCTION is to preserve the oid. Yours, Laurenz Albe