From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Erik Wienhold <ewie(at)ewie(dot)name> |
Cc: | Said Assemlal <sassemlal(at)neurorx(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: CREATE OR REPLACE MATERIALIZED VIEW |
Date: | 2025-04-05 20:37:08 |
Message-ID: | 2724629.1743885428@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Erik Wienhold <ewie(at)ewie(dot)name> writes:
> [ v6 patches ]
A couple of drive-by comments:
* I think the proposal to deprecate IF NOT EXISTS is a nonstarter.
Yeah, I don't like it much, but the standard of proof to remove
features is amazingly high and I don't think it's been reached here.
We're unlikely to remove IF NOT EXISTS for tables, and to the extent
that matviews are like tables it's reasonable for them to have it too.
* On the other hand, the semantics you've implemented for CREATE OR
REPLACE are not right. The contract for any form of C.O.R. is that
it will either fail, or produce exactly the same object definition
that you would have gotten from plain CREATE with no conflicting
object. The v6 code is visibly not doing that for properties such
as tablespace --- if the command doesn't mention that, you don't
get the default tablespace, you get whatever the old object had.
* BTW, I'm inclined to think that WITH OLD DATA ought to fail
if the command isn't replacing an existing matview. It seems
inconsistent to silently reinterpret it as WITH DATA, just as
silently reinterpreting "no tablespace mentioned" as "use the
old tablespace" is inconsistent. I'm not dead set on that
but it feels wrong.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Shayon Mukherjee | 2025-04-05 21:00:59 | Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX |
Previous Message | Andres Freund | 2025-04-05 20:32:00 | Re: Parallel heap vacuum |