Rework to make it Postgresql compatible.