Fix incompatibility with databases != postgresql