create or replace rule/view

Поиск
Список
Период
Сортировка
От Gavin Sherry
Тема create or replace rule/view
Дата
Msg-id Pine.LNX.4.21.0208120314450.17818-101000@linuxworld.com.au
обсуждение исходный текст
Ответы Re: create or replace rule/view  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: create or replace rule/view  (Jean-Michel POURE <jm.poure@freesurf.fr>)
Список pgsql-patches
Attached is a patch implementing:

create or replace rule ...
create or replace view ...

It passes all regression tests. There's only one really sketchy part of
the patch: UpdateAttributeTuples(). This routine is fairly dangerous since
it simply removes a given relid's pg_attribute entries and creates a new
set basic on a given TupleDesc. Naturally, it is only useful for views.

It is important to have this functionality so that you can do something
like:

template1=# create view abc as select 'test'::text as a;
CREATE VIEW
template1=# select * from abc;
  a
------
 test
(1 row)

template1=# create or replace view abc as select '1'::int2 as a;
CREATE VIEW
template1=# select * from abc;
 a
---
 1
(1 row)

Regardless, the patch may need some cleaning up. Unfortunately, I don't
have enough time on my hands over the coming week. Considering beta is
coming up I thought it best to submit and see what happens.

Gavin

Вложения

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

Предыдущее
От: Gavin Sherry
Дата:
Сообщение: Re: CREATE OR REPLACE TRIGGER
Следующее
От: Joe Conway
Дата:
Сообщение: Re: create or replace rule/view