CREATE OR REPLACE MATERIALIZED VIEW

Поиск
Список
Период
Сортировка
От Aidan Samuel
Тема CREATE OR REPLACE MATERIALIZED VIEW
Дата
Msg-id CAAWhf=PHch2H3ekYnbafuwqWqwyRok8WVPaDxKosZE4GQ2pq5w@mail.gmail.com
обсуждение исходный текст
Ответы Re: CREATE OR REPLACE MATERIALIZED VIEW  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I've been looking over the syntax for creating various database objects: tables, views, functions, etc., and I wondered why there seem to be some discrepancies.

For example, table creation syntax features [ IF NOT EXISTS ] but doesn't feature [ OR REPLACE ], function creation syntax is the inverse and has [ OR REPLACE ], but no [ IF NOT EXISTS ].

I also noticed that the syntax for creating VIEWS and creating MATERIALISED VIEWS is handled separately [1][2].

I was expecting to see one page of documentation with the syntax listed as something like: CREATE [ OR REPLACE ] [ MATERIALIZED ] VIEW [ IF NOT EXISTS ] view_name.

Is this because a materialized view is actually a table and thus inherits the table creation syntax instead of the view creation syntax?

How come table creation doesn't allow [ OR REPLACE ], and view creation doesn't allow [ IF NOT EXISTS ]? Is this just how the SQL spec defines things?

Thanks,
Aidan.


В списке pgsql-general по дате отправления:

Предыдущее
От: Martín Marqués
Дата:
Сообщение: Re: postgres operational
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CREATE OR REPLACE MATERIALIZED VIEW