Wrote and tested a pretty simple script in SQL. Now I need to get it working in Postgres (which I\'m just learning). Can\'t figure out the latest error. The script is reading a