Re: BUG #18892: When the view already exists, CREATE OR REPLACE VIEW does not check whether the table exists.

Kirill Reshke <reshkekirill@gmail.com>

From: Kirill Reshke <reshkekirill@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: gchen@s2now.com, pgsql-bugs@lists.postgresql.org
Date: 2025-04-13T13:09:19Z
Lists: pgsql-bugs
On Sun, 13 Apr 2025 at 00:33, David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> Kirill's answer is correct; though it is a bit annoying that "create view" cannot detect the infinite recursion inherent in its body.
>
> David J.
>

Hm, if we can detect infinite recursion at runtime, we should also be
able to do it definition-time, on "create or replace". Is there any
reason we omit such a check (for recursive views/relations) when
executing ddl?

-- 
Best regards,
Kirill Reshke