rewriter in updateable views

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема rewriter in updateable views
Дата
Msg-id c2d9e70e050318141255555d13@mail.gmail.com
обсуждение исходный текст
Ответы Re: rewriter in updateable views  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

Bernd and myself are working in updateable views, one thing we find is
that when we have something like:

create table foo (    col1   serial,    col2   text   default 'default'
);

create view vfoo as select * from foo;

then we create the appropiate rules for allow INSERT /UPDATE /DELETE on the view

but if we do INSERT INTO vfoo(col2) values ('some_string) the rewriter
cann resolv the value for col1. the reason is that views does not
inherit the defaults of the parent table. That is the reason you add
the ALTER TABLE  ALTER COLUMN ADD/DROP DEFAULT for views.

Ok, this is a problem for us, so we want to improve the rewriter to
see the default in the base table an add it as appropiate.

Can you comment on this? Are there any issues here we have not seen
yet? performance? possible?

regards,
Jaime Casanova


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

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: [pgsql-www] "they only drink coffee at dec"
Следующее
От: Neil Conway
Дата:
Сообщение: Re: read-only planner input