Re: 回复: BUG #18892: When the view already exists, CREATE OR REPLACE VIEW does not check whether the table exists. - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: 回复: BUG #18892: When the view already exists, CREATE OR REPLACE VIEW does not check whether the table exists.
Date
Msg-id Z__eIEU2vKvisr5Z@momjian.us
Whole thread Raw
In response to 回复: BUG #18892: When the view already exists, CREATE OR REPLACE VIEW does not check whether the table exists.  (Gang Chen <gchen@s2now.com>)
List pgsql-bugs
On Mon, Apr 14, 2025 at 08:55:04AM +0000, Gang Chen wrote:
> Hello,
> 
> But isn't that kind of strange? If it's just a very simple view, first of all,
> referencing itself would result in an infinite recursion error. Also, it
> doesn't seem to have any practical use. Secondly, during pg_upgrade or backup
> and restore processes, it might introduce unnecessary errors and additional
> handling procedures.

You are right, but disallowing only that setup would be confusing. To
keep the user interface simple, we should either allow a general class
of things or disallow them.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Do not let urgent matters crowd out time for investment in the future.



pgsql-bugs by date:

Previous
From: Devrim Gündüz
Date:
Subject: Re: BUG #18895: Installation failure on Fedora 42 due to missing repos
Next
From: PG Bug reporting form
Date:
Subject: BUG #18896: A potential problem in heap_page_items (pageinspect, PG-17)