more postgres lameness

TeeJay on 2006-03-22T10:35:21

Just as I thought Postgres' quirky behaviour was having less of an impact on development I hit this lame barrier :

SELECT DISTINCT ON expressions must match initial ORDER BY expressions

It's entirely reasonable to want unique by pk, but order by a date field, thats' the kind of thing we use databases for, but no - Postgres requires that the distinct restriction matches the order by.

Very lame and incredibly annoying


work around

TeeJay on 2006-03-22T10:37:32

Of course ugly hack of a work around (which btw is how I'd describe Slony ;p), is to copy and paste the whole of your order by clause into the uniqueness clause. lame lame lame lame.