I have in my database records which contains Polish characters like: ś, ć, ż, ź.
It happen to be a problem for me when I try to execute some of the SELECT statements..
Because I get my text but instead of characters I wrote above I get: <c4><85>.
I bet there is a way I can change encoding for example for utf-8, but how can I do that for simple query like select * from table?
As you’ve indicated this is on the console, you must first check your console encoding before starting psql.
See Unicode characters in Windows command line – how? for details of how to do this in windows.
This must be done because even if you do get
psqlto read / write in UTF8 your console won’t necessarily understand the characters and will not display them correctly.Once you’ve confirmed that your console can accept UTF-8 Encoding then makesure that psql has picked this encoding up:
If that doesn’t show UTF-8 then you can use:
As a general rule; if your program is expecting to use UTF8 then there is no harm in setting the client encoding blindly (without checking what it is to start with).
http://www.postgresql.org/docs/current/static/multibyte.html
Note:
The above link is for the current version. As the OP has asked for version 8.0, here is the link for the 8.0 manual:
See http://www.postgresql.org/docs/8.0/static/multibyte.html