Search code examples
postgresqlbatch-fileutf-8byte-order-mark

create batch file for postgres in japanese os


I have a batch file (01_update.bat) and SQL (update.sql) file

01_update.bat

echo.
pause
"C:\Program Files\PostgreSQL\9.5\bin\psql.exe" -U postgres -d javasamplepj_core -f .\update.sql 
pause

update.sql

DELETE FROM "CORE_LANGUAGE_PROPERTY" WHERE "KEY" = 'error_incompletedate';

==> but when I run batch file I get this error:

psql: ./ update.sql: 1: ERROR: the 0xef 0xbb byte sequence in the coding scheme "SJIS" Character is not equal in the "UTF8" encoding scheme with


Solution

  • Googling for the 0xef 0xbb byte sequence leads to BOM. In Notepad++ for example you can specify if you want to have it saved with or without BOM. That should do the trick.