I have the following script to create a table:
-- Create State table.
DROP TABLE IF EXISTS \"State\" CASCADE;
CREATE TABLE \"State\" (
StateID SERIAL PRIMAR
What version(-s) do you use? IF EXISTS came with version 8.2, maybe you're connection with version 8.1 or older when you use psql.
To remove BOM sequence on Ubuntu you can use bomstrip, bomstrip-files
Run your file 00101-CreateStateTable.sql through a hex dumper. I'll bet you have a UTF-16 marker at the beginning of the file (before the "--" comment characters).
Thank you guys. I have been struggling with this issue for a few weeks. I could not run my SQL scripts using PSQL. I thought I have some issues with my OS, now I know it is the BOM issue in my text file. I installed bomstrip packet in Ubuntu and now all my SQL scripts are working again.