Re: CREATE OR REPLACE MATERIALIZED VIEW

2025-01-12 Thread Erik Wienhold
Here's a rebased v5 due to conflicts with de1e298857. No other changes since v4. -- Erik Wienhold From ac9bba0960f7a6fa507020400f1b4bcf4c9a25d3 Mon Sep 17 00:00:00 2001 From: Erik Wienhold Date: Tue, 21 May 2024 18:35:47 +0200 Subject: [PATCH v5 1/3] Add CREATE OR REPLACE MATERIALIZED

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-10-30 Thread Michael Paquier
On Tue, Jul 02, 2024 at 01:46:21PM +0300, Aleksander Alekseev wrote: > I can imagine how this may impact many applications and upset many > software developers worldwide. Was there even a precedent (in the > recent decade or so) when PostgreSQL broke the SQL syntax? We're usually very careful abou

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-10-30 Thread Erik Wienhold
ng it and then run the concurrent refresh, like > > > > this: > > > > > > > > CREATE OR REPLACE MATERIALIZED VIEW foo AS ... WITH NO DATA; > > > > REFRESH MATERIALIZED VIEW CONCURRENTLY foo; > > > > > > > > But that wo

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-09-05 Thread Erik Wienhold
covers all matview cases in psql's tab completion. I > missed some of them with v1. Here's a rebased version due to conflicts with f683d3a4ca and 1e35951e71. No other changes since v2. -- Erik >From 158f025fa2696a4a807def4a3c533982cfd7b318 Mon Sep 17 00:00:00 2001 From: Erik Wienhold Date: Tue, 21 May 20

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-26 Thread Erik Wienhold
On 2024-07-12 16:49 +0200, Said Assemlal wrote: > > My initial idea, while writing the patch, was that one could replace the > > matview without populating it and then run the concurrent refresh, like > > this: > > > > CREATE OR REPLACE MATERIALIZE

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-12 Thread Said Assemlal
concurrent refresh, like this: CREATE OR REPLACE MATERIALIZED VIEW foo AS ... WITH NO DATA; REFRESH MATERIALIZED VIEW CONCURRENTLY foo; But that won't work because concurrent refresh requires an already populated matview. Right now the patch either populates the replaced matview or l

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-05 Thread Erik Wienhold
This is also the case for CREATE OR REPLACE VIEW. My initial idea, while writing the patch, was that one could replace the matview without populating it and then run the concurrent refresh, like this: CREATE OR REPLACE MATERIALIZED VIEW foo AS ... WITH NO DATA; REFRESH MATERIALIZED VIEW CON

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-04 Thread Said Assemlal
CREATE OR REPLACE VIEW: * the new query may change SELECT list expressions of existing columns * new columns can be added to the end of the SELECT list * existing columns cannot be renamed * the data type of existing columns cannot be changed In addition to that, CREATE OR REPLACE MATERIALIZED VIEW

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-02 Thread Daniel Gustafsson
> On 2 Jul 2024, at 15:58, Erik Wienhold wrote: > On 2024-07-02 14:27 +0200, Daniel Gustafsson wrote: >> Considering the runway we typically give for deprecations, that seems like a >> fairly short timeframe for a SQL level command which isn't unlikely to exist >> in application code. > > Is ther

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-02 Thread Erik Wienhold
I wrote: > Patch 0002 deprecates CREATE MATERIALIZED VIEW IF NOT EXISTS because it > no longer seems necessary with patch 0001. Tom Lane commented[1] about > the general dislike of IF NOT EXISTS, to which I agree, but maybe this > was meant only in response to adding new commands. One could also

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-02 Thread Daniel Gustafsson
> On 2 Jul 2024, at 03:22, Erik Wienhold wrote: > Patch 0002 deprecates CREATE MATERIALIZED VIEW IF NOT EXISTS because it > no longer seems necessary with patch 0001. Tom Lane commented[1] about > the general dislike of IF NOT EXISTS, to which I agree, but maybe this > was meant only in response

Re: CREATE OR REPLACE MATERIALIZED VIEW

2024-07-02 Thread Aleksander Alekseev
Hi, > Patch 0002 deprecates CREATE MATERIALIZED VIEW IF NOT EXISTS because it > no longer seems necessary with patch 0001. Tom Lane commented[1] about > the general dislike of IF NOT EXISTS, to which I agree, but maybe this > was meant only in response to adding new commands. Anyway, my idea is

CREATE OR REPLACE MATERIALIZED VIEW

2024-07-01 Thread Erik Wienhold
I like to add CREATE OR REPLACE MATERIALIZED VIEW with the attached patches. Patch 0001 adds CREATE OR REPLACE MATERIALIZED VIEW similar to CREATE OR REPLACE VIEW. It also includes regression tests and changes to docs. Patch 0002 deprecates CREATE MATERIALIZED VIEW IF NOT EXISTS because it no