Writable Views as Tables (for clients that won't write to views)
От | Thomas Warwaris |
---|---|
Тема | Writable Views as Tables (for clients that won't write to views) |
Дата | |
Msg-id | 1287275918.4712.48.camel@bes.tw.priv обсуждение исходный текст |
Список | pgsql-jdbc |
Hi, i am working towards proof of concept code to trick "intelligent" JDBC Clients into believing that views are tables (so that they write in it) and i am reaching the point where things start to work. I'd love to get some response: Ideas about what things i could break with that, maybe additional ideas - and maybe there's a brighter idea than that? By now it works that way: An additional table in the database holds the table oid and the name of the column, that will be given to the client as primary key. It's ok for me in that simple way, because in the view i can build the pkey from whatever i want anyway. Then, in the metadata: - the view is reported to the client as a table - the pkey column is reported as not nullable, auto increment - an index is returned (with CARDINALITY of count(*) and PAGES beeing fantasy) Does anyone know, what clients need PAGES for? Is it used with SQL backends? By now, that seems to be enough for oobase to work with it. Todo: Read only and not null constraints. Some thoughts: Maybe not "a good idea to do that in the driver" - but it is generic, and works with JDBC clients, that try to be more intelligent than the database. Of course it breaks clients, when they try to change the table structure. But if they put their fingers in there, they'd better know about writable views anyway.
В списке pgsql-jdbc по дате отправления: