Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own - Mailing list pgsql-bugs

From Laurenz Albe
Subject Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
Date
Msg-id c48613a5ef709ae349e7f9509fa52b578b0eaecb.camel@cybertec.at
Whole thread Raw
In response to Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
List pgsql-bugs
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...
>
> When resolving the dependency graph for such a function can we prevent the
> 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 “or replace”.

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



pgsql-bugs by date:

Previous
From: Katja Henke
Date:
Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own