Convert mysql script to psql
Reference: http://en.wikibooks.org/wiki/Converting_MySQL_to_PostgreSQL#SQL