筆記下用 powershell 批次執行 psql 遇到的問題
RROR: character with byte sequence 0x82 0x99 in encoding
“BIG5” has no equivalent in encoding “UTF8”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| $env:PGCLIENTENCODING = "utf8" $env:PGPASSWORD = "postgres" $host_ip = "localhost" $username = "postgres" $database = "postgres"
Get-ChildItem -Path .\sqls -Filter *.sql | ForEach-Object { Write-Host "正在執行 $($_.Name)..." psql -h $host_ip -U $username -d $database -f $_.FullName }
$env:PGPASSWORD = "" $env:PGCLIENTENCODING = "" Write-Host "所有 SQL 檔案執行完畢!"
|