Simon Riggs wrote:

> This seems very similar to the REPLACE command we discussed
> earlier, except this is restricted to Mat Views.

I don't remember that discussion -- do you have a reference?

> If we're going to have this, I would prefer a whole command.
> 
> e.g. REPLACE matviewname REFRESH
> 
> that would also allow
> 
> REPLACE tablename AS query
> 
> Same thing under the covers, just more widely applicable and thus
> more useful.

An interesting throught. I would have thought that if we were going
to allow changing the definition of an existing MV, we would be
better off with CREATE OR REPLACE MATERIALIZED VIEW. Either way, if
you allow the column types or the number of columns to be changed,
you do tend to run into issues if there are other MVs, views,
triggers, rules, etc., which depend on the MV, so I don't think it's
material for an initial patch. But it is worth considering which way
we might want to extend it.

> Either way, I don't much like overloading the use of LOAD, which
> already has a very different meaning.

Well, it's hard to avoid creating new keywords without overloading
the meaning of exsiting ones. Personally I didn't find

  LOAD MATERIALIZED VIEW matview_name;

to be very easy to confuse with

  LOAD 'filename';

But that's a subjective thing. If too many people find that
confusing, it may be worth creating a new keyword; but I wanted to
see whether it was really necessary first.

-Kevin


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to