rewriter in updateable views - Mailing list pgsql-hackers

From Jaime Casanova
Subject rewriter in updateable views
Date
Msg-id c2d9e70e050318141255555d13@mail.gmail.com
Whole thread Raw
Responses Re: rewriter in updateable views
List 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 by date:

Previous
From: "Dave Page"
Date:
Subject: Re: [pgsql-www] "they only drink coffee at dec"
Next
From: Neil Conway
Date:
Subject: Re: read-only planner input