I think the 2d request of the method : void removeObject(Connection connection, Uri uri, ObjectNode object) In the class : org.apache.slide.store.impl.rdbms.PostgresRDBMSAdapter will not work : delete from VERSION_HISTORY where VERSION_HISTORY.URI_ID = URI.URI_ID and URI.URI_STRING = ?" Because the element *URI.URI_ID* is unknown.
Hello Olivier, I do not have a slide installation with a Postgres backend to test that. I am relatively new in slide development. All the SQL statements in this class look weird, because they are all referencing columns of this URI table. instead of : delete from VERSION_HISTORY where VERSION_HISTORY.URI_ID = URI.URI_ID and URI.URI_STRING = ?" I would expect delete from VERSION_HISTORY where VERSION_HISTORY.URI_ID IN (SELECT URI_ID FROM URI where URI_STRING = ?)" Could you try it ? If this change works, then probably most or all the SQL statements in this class need a similar change. Regards, Antoine
The current syntax is correct. This is a non-standard syntax in PostgreSQL SQL. As explained in the PostgreSQL documentation: Notes PostgreSQL lets you reference columns of other tables in the WHERE condition. For example, to delete all films produced by a given producer, one might do DELETE FROM films WHERE producer_id = producers.id AND producers.name = 'foo'; What is essentially happening here is a join between films and producers, with all successfully joined films rows being marked for deletion. This syntax is not standard. A more standard way to do it is DELETE FROM films WHERE producer_id IN (SELECT id FROM producers WHERE name = 'foo');
Hi, I've had the same problem and i've solved it like this : - add a USING foo1, foo2,... clause in the query ex : delete from VERSION_HISTORY using URI where VERSION_HISTORY.URI_ID = URI.URI_ID and URI.URI_STRING = ? It works for me (PostgreSQL 8.2.3) Nicolas Aguilé