Replaced deprecated function calls from ddl so it wont break with postgresql9.2

Should still be compatible with older versions.