Use a proper sqlstate with non-setof function errors

Signed-off-by: Oskari Saarenmaa <os@ohmu.fi>