[OSM-dev] Data corruption :) II

Dave Stubbs osm.list at randomjunk.co.uk
Wed Nov 26 13:19:43 GMT 2008


>> Otherwise you could make this check in postgres using the CHECK
>> expression table/column constraint. And possibly some stored
>> procedures. But we're then writing very close to the database layer.
>> And not even our current database layer, as I don't know if mysql
>> supports this.
>
> i don't think postgres supports a check constraint on a column in a
> different table linked by foreign key. at least, if it does they're
> keeping quiet about it...


Yes, it doesn't support subqueries in the check expression direcly,
however it does support function calls, which is where the stored
procedures come in. So it's possible to do it, but whether it's either
efficient or desirable is another matter :-).




More information about the dev mailing list