Skip to content

Instantly share code, notes, and snippets.

@Phrogz
Created August 12, 2011 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phrogz/1142428 to your computer and use it in GitHub Desktop.
Save Phrogz/1142428 to your computer and use it in GitHub Desktop.
Codepage 65001 prevents psql.exe from working
C:\>"\Program Files\PostgreSQL\9.0\bin\psql.exe" -U postgres -p 5434 uxt
psql (9.0.4)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
uxt=# \dt
List of relations
Schema | Name | Type | Owner
--------+------------------+-------+--------
public | action_types | table | uxtmin
public | actions | table | uxtmin
public | activation_types | table | uxtmin
public | activations | table | uxtmin
public | customers | table | uxtmin
public | day_actions | table | uxtmin
public | events | table | uxtmin
public | os | table | uxtmin
public | products | table | uxtmin
public | releases | table | uxtmin
public | schema_info | table | uxtmin
public | sessions | table | uxtmin
public | versions | table | uxtmin
(13 rows)
uxt=# \q
C:\>chcp 65001
Active code page: 65001
C:\>"\Program Files\PostgreSQL\9.0\bin\psql.exe" -U postgres -p 5434 uxt
psql (9.0.4)
WARNING: Console code page (65001) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
uxt=# \dt
Not enough memory.
uxt=#
@weidongguo
Copy link

I get the same problem. Still don't know how to fix that.

However, there is an alternative that works for me. Try switching to code page 38598 (ISO-8859-8)
type

chcp 38598

at your command prompt

Remark:
I mean I can switch back to my original code page (936). It will work (all the queries and like \dt) but the warning message will messed up. Switching to 65001 fix this issue, but has another issue - not enough memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment