better solution to postgres dynamic link error