pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Yushu Chen <gentcys@gmail.com>
Cc: katja.henke@foo.ag <katja.henke@foo.ag>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
Date: Sun, 07 Sep 2025 23:09:06 +0200
Message-ID: <c48613a5ef709ae349e7f9509fa52b578b0eaecb.camel@cybertec.at> (raw)
In-Reply-To: <CAKFQuwYfD-JE8svtfJcgCHce=8ag5000Gms4hr=JXH+L8CWhPQ@mail.gmail.com>
References: <19034-de0857b4f94ec10c@postgresql.org>
	<CAP5x3pZvk6D9b9mmKBEYKqZvJcDpH5OfZ419aVgzr+xXpo4O=w@mail.gmail.com>
	<1030106.1756999498@sss.pgh.pa.us>
	<8dec121e2d3bfc1149d36359345fbce1faa087aa.camel@cybertec.at>
	<CAKFQuwYfD-JE8svtfJcgCHce=8ag5000Gms4hr=JXH+L8CWhPQ@mail.gmail.com>

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





view thread (13+ messages)  latest in thread

Message-ID: <c48613a5ef709ae349e7f9509fa52b578b0eaecb.camel@cybertec.at>
Permalink:  ../c48613a5ef709ae349e7f9509fa52b578b0eaecb.camel@cybertec.at/
Also on:    postgresql.org/message-id/c48613a5ef709ae349e7f9509fa52b578b0eaecb.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: laurenz.albe@cybertec.at, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us, gentcys@gmail.com, katja.henke@foo.ag, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19034: Recursive function with sql_body can replace an existing function but can not be created on it's own
  In-Reply-To: <c48613a5ef709ae349e7f9509fa52b578b0eaecb.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox