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

From: Kirill Reshke <reshkekirill(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: gchen(at)s2now(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18892: When the view already exists, CREATE OR REPLACE VIEW does not check whether the table exists.
Date: 2025-04-13 13:09:19
Message-ID: CALdSSPgvZmd=Bc1n8CCuFws1uEmejbKeSQ-UpNoVyQ6AceCu7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, 13 Apr 2025 at 00:33, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-04-13 14:05:05 Re: BUG #18892: When the view already exists, CREATE OR REPLACE VIEW does not check whether the table exists.
Previous Message Robins Tharakan 2025-04-13 12:11:00 Re: BUG #18893: Segfault during analyze pg_database