[Dbix-class] Deleting with JOIN's

Zbigniew Lukasiak zzbbyy at gmail.com
Thu Oct 23 11:56:26 BST 2008


On Thu, Oct 23, 2008 at 12:33 PM, Nigel Metheringham
<nigel.metheringham at dev.intechnology.co.uk> wrote:
> Strangely we were having a discussion about this on irc yesterday.
>
> The bottom line is basically a DELETE that involves a join will not generate
> correct SQL.
> This is at least partly down to the SQL spec not really supporting that sort
> of complexity in a DELETE statement, although some implementations of SQL (I
> think PostgreSQL is one)  will do so, however the SQL generator does not
> generate anything sensible in this case.
>

Just for refference:
MySQL 5.0 - http://dev.mysql.com/doc/refman/5.0/en/delete.html
PostgreSQL 8.3 -
http://www.postgresql.org/docs/current/interactive/sql-delete.html

Both support DELETE with joins (Pg 8.0 does not
http://www.postgresql.org/docs/8.0/static/sql-delete.html) using
'USING' clause.

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/



More information about the DBIx-Class mailing list