[baseten-users] updating of SQL-views

Patrick De Visschere pdvisschere at fulladsl.be
Sat Jan 30 15:37:42 EET 2010


Hi,

I have a problem with accessing an SQL-view;
In short it looks like the automatic updating of data-objects does not  
work properly if baseten is connected to an SQL-view  instead of  
directly to a table. It works when inserting a new object but no  
longer when subsequently updating it.

I have a single table and an SQL-view of that table; baseten is  
connected to the view and the required SQL-RULES are present.
- when I make changes in the table with pgAdmin, these are not shown  
in the Cocoa-views. This is probably normal since baseten is connected  
to the SQL-view. I enabled also the underlying table with the  
assistant but that makes no difference.
- let's say that 1 column of the table is the sum of 2 other columns  
(the sum is calculated by PostgreSQL) ; when I make changes in the  
Cocoa-views then the  SQL-table is properly updated but the sum never  
shows up in the Cocoa-view although it's value is returned by the  
RETURNING clause in the SQL- view RULES.
- The view also contains a running-total; should this also be updated  
automatically by BaseTen in the Cocoa-views?

I would appreciate if someone could explain what should happen in  
these cases.

I've tried to find out what happens by watching the executeQuery  
method in PGTSConnection:
I notice that when a new object is created besides the INSERT query  
also SELECT queries are generated but when doing an update besides the  
UPDATE query no SELECT queries are generated except for one querying  
the baseten.modification table.
This seems compatible with what I observed higher.

Regards,

P. De Visschere




More information about the baseten-users mailing list