Creating a view: ERROR: rules on SELECT must have action INSTEAD SELECT

Поиск
Список
Период
Сортировка
От David Waddy
Тема Creating a view: ERROR: rules on SELECT must have action INSTEAD SELECT
Дата
Msg-id 10c46bc21003190457k16d228bck36653796ee8bf1e8@mail.gmail.com
обсуждение исходный текст
Ответы Re: Creating a view: ERROR: rules on SELECT must have action INSTEAD SELECT
Список pgsql-general
I get the following error when trying to create a view with the
following trivial example.

SQL error:
ERROR:  rules on SELECT must have action INSTEAD SELECT

In statement:
CREATE VIEW "nutrition"."test_view" AS SELECT 2 as two, 3 as three
INTO TEMP temp_table; SELECT *,two+three as five FROM temp_table;

If I rewrite the statement to maybe make more sense:

SQL error:

ERROR:  temporary tables cannot specify a schema name

In statement:

SELECT 2 as two, 3 as three INTO TEMP nutrition.temp_table; CREATE
VIEW "nutrition.test_view" AS  SELECT *,two+three as five FROM
nutrition.temp_table;

So the question is how do I use the powerful feature of temporary
tables with views? And if this is not possible, how do I do something
similar for optimization reasons (ie pretend "two+three as five" is
some very expensive operation and "two" and "three" were also
expensive operations)?

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: AIX postgresql error
Следующее
От: APseudoUtopia
Дата:
Сообщение: Order of Daily VACUUM, CLUSTER, REINDEX