FIX: make lazy loading hack work with pgsql