Обсуждение: Help loading data. Error code page 850

Поиск
Список
Период
Сортировка

Help loading data. Error code page 850

От
chris chris
Дата:
-------------begin message--------------

1.  Warning: Console code page (850) differs from Windows code page (1252) 8-bit characters may not work correctly. See psql reference 
page "Notes for Windows users" for details. 

After searching and reading, I am still not sure how to remedy this error.   I suspect it is important, as I have not been able to load any data to my introductory database.  Could anyone point me to some basic, step by step instructions?    

A recent thread to which Bob Pawley, Adrian Klavar (and perhaps elsewhere, Tamar Tahir) have contributed touches upon solutions to the problem.  Also, I came across the following in the PostgresQL 9.0.3 Documentation:

Notes for Windows users

psql is built as a "console application". Since the Windows console windows
use a different encoding than the rest of the system, you must take special
care when using 8-bit characters within psql. If psql detects a problematic
console code page, it will warn you at startup. To change the console code
page, two things are necessary:

Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code page
that is appropriate for German; replace it with your value.) If you are
using Cygwin, you can put this command in /etc/profile.

Set the console font to Lucida Console, because the raster font does not
work with the ANSI code page.


-----------over and out------------

cpatrouch (at) gmail (dot) com

Re: Help loading data. Error code page 850

От
Michael Wood
Дата:
Hi

On 18 February 2011 18:52, chris chris <cpatrouch@gmail.com> wrote:
> -------------begin message--------------
> 1.  Warning: Console code page (850) differs from Windows code page (1252)
> 8-bit characters may not work correctly. See psql reference
> page "Notes for Windows users" for details.
> After searching and reading, I am still not sure how to remedy this error.
> I suspect it is important, as I have not been able to load any data to my
> introductory database.  Could anyone point me to some basic, step by step
> instructions?
> A recent thread to which Bob Pawley, Adrian Klavar (and perhaps elsewhere,
> Tamar Tahir) have contributed touches upon solutions to the problem.  Also,
> I came across the following in the PostgresQL 9.0.3 Documentation:
> Notes for Windows users
>
> psql is built as a "console application". Since the Windows console windows
> use a different encoding than the rest of the system, you must take special
> care when using 8-bit characters within psql. If psql detects a problematic
> console code page, it will warn you at startup. To change the console code
> page, two things are necessary:
>
> Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code page
> that is appropriate for German; replace it with your value.) If you are
> using Cygwin, you can put this command in /etc/profile.

I have not used Postgres on Windows, but have you tried typing
"cmd.exe /c chcp 1252" in the command prompt window before running
psql?

> Set the console font to Lucida Console, because the raster font does not
> work with the ANSI code page.

Do you know how to do this and did you do it (as well as changing the
code page) before running psql?

So, I suppose what I would try is the following:

1.)  Open up a Command Prompt window.
2.)  Type "cmd.exe /c chcp 1252"
3.)  Click on the icon on the left of the title bar and choose
Properties and then in the Font tab, choose "Lucida Console" as the
font.
4.)  Run whatever command you were trying to run when you got the warning.

> -----------over and out------------
> cpatrouch (at) gmail (dot) com

--
Michael Wood <esiotrot@gmail.com>

Re: Help loading data. Error code page 850

От
Michael Wood
Дата:
Hi

I've added the mailing list back in.

On 19 February 2011 00:12, Christopher Patrouch <cpatrouch@gmail.com> wrote:
> Hi Michael,
>
> Thanks so much for getting back to me.
>
> You outlined four steps.  I followed them all (until now, I didn't know I
> could click on the icon on the cmd prompt, properties, font.  There it was,
> Lucida console.)
>
> Then I open the PSQL console, and I still get the warning about console page
> 850 differing from 1252.  I'm actually getting confused about which one I
> should be going for.  Here's a lot of detail, but maybe I'm on the right
> track:

OK, I don't know what you mean by "open the PSQL console".  Did you
run "psql" from the console where you changed the code page and font?

> 1.  I opened up a command prompt from my user directory so I typed in cd\ to
> get to the root directory.  From there, I typed cmd.exe /c chcp 1252.  My
> computer os is in French, so I got a message that translates to "page code
> activated: 1252"

OK, after this you should change the font for this Command Prompt
window (or else use the "Update shortcut" option to change it
permanently for all future Command Prompt windows).  Then, from this
command prompt window, run the psql command or whatever non-GUI tool
you were using to import the data.

> 2.  IPostGIS, using PgAdmin III Shape Loader, I tried to load a Shape file
> (associated with two other files of the same name, one of which should have
> a .dbf extension)  again, but it fails (saying it can't find the .dbf file;
> this is inicidental...but it shows up in the directory as an Open Office
> file, even though when I open in Open Office, it shows up with a .dbf
> extension .... hmmm.  I just double-clicked on it and I get a menu "Import
> DBase Files, Character set" and it offers me a long list of choices,
> including Western Europe (Windows-1252/WinLatin 1); so I selected that one.
>  I open it, then save it.  Use the latest ODF format or Keep Format.  I
> chose Keep Current Format.  I get an error message regarding max number of
> characters and decimal places, 19 and 11, respectively. There are 20
> characters (including the decimal point).  So couldn't save it in the
> current format.

.dbf is normally used for DBase files (or similar database files), but
I don't know if that's true for your files.  I am not sure opening the
files in OpenOffice is a good idea, and saving them again from
OpenOffice is not likely to do any good, and might corrupt the results
too.

I am not familiar with IPostGIS and have not used PgAdmin III, so I'm
not sure how this is meant to work, but I assume they are both GUI
tools and therefore should not be affected by the settings in the
Command Prompt window.

> Clearly I'm on to something regarding this particular data set, if not the
> problem in general.

I'm not convinced :)

> 3.  When I typed cmd.exe chcp 1252, I saw nothing afterwards except the
> message about the activated code page.  Then I navigated to the directory in
> which I find my psql file.  I ran the command psql and was prompted for my
> password, which I understand should be the same as that which I gave when
> installing PostgreSQL.  I got a FATAL:  password authentication failed for
> user "Cristòbal" (except the ò showed up in DOS as a Greater than or Equal

You might need to specify the username to use instead of your Windows
username.  The username for accessing PostgreSQL needn't have anything
to do with the Windows username.

> sign -- When I got my computer, I set it up using the Spanish spelling of my
> name, Cristòbal... and needless to say that has caused a lot of problems.
>  I'll never use a accent marks again for that type of thing).
>
> For now, I'm still stuck at the beginning.  Maybe I should reboot?

Rebooting is unlikely to improve the situation.

> Thanks again,

No problem.  I hope my e-mail helps.

> Chris

--
Michael Wood <esiotrot@gmail.com>

Re: Help loading data. Error code page 850

От
Christopher Patrouch
Дата:
Glad to report that all is fine.  

Reinstalled PostgreSQL under a different Windows user name.  Used the default path for the data files.  Changed the pg_hba.conf file permissions.  Learned the difference between the PostgreSQL psql prompt and the Windows cmd prompt. Remembered to put quotes around file paths (where needed), and eliminated some external variables (such as an accented Windows user account name). 

So all seems to be working pretty well and I'm enjoying it.  Thanks again for your response to my initial inquiry.   And, Michael, you were right -- turned out not to have anything to do with the Open Office files. 

On Sat, Feb 19, 2011 at 7:48 AM, Michael Wood <esiotrot@gmail.com> wrote:
Hi

I've added the mailing list back in.

On 19 February 2011 00:12, Christopher Patrouch <cpatrouch@gmail.com> wrote:
> Hi Michael,
>
> Thanks so much for getting back to me.
>
> You outlined four steps.  I followed them all (until now, I didn't know I
> could click on the icon on the cmd prompt, properties, font.  There it was,
> Lucida console.)
>
> Then I open the PSQL console, and I still get the warning about console page
> 850 differing from 1252.  I'm actually getting confused about which one I
> should be going for.  Here's a lot of detail, but maybe I'm on the right
> track:

OK, I don't know what you mean by "open the PSQL console".  Did you
run "psql" from the console where you changed the code page and font?

> 1.  I opened up a command prompt from my user directory so I typed in cd\ to
> get to the root directory.  From there, I typed cmd.exe /c chcp 1252.  My
> computer os is in French, so I got a message that translates to "page code
> activated: 1252"

OK, after this you should change the font for this Command Prompt
window (or else use the "Update shortcut" option to change it
permanently for all future Command Prompt windows).  Then, from this
command prompt window, run the psql command or whatever non-GUI tool
you were using to import the data.

> 2.  IPostGIS, using PgAdmin III Shape Loader, I tried to load a Shape file
> (associated with two other files of the same name, one of which should have
> a .dbf extension)  again, but it fails (saying it can't find the .dbf file;
> this is inicidental...but it shows up in the directory as an Open Office
> file, even though when I open in Open Office, it shows up with a .dbf
> extension .... hmmm.  I just double-clicked on it and I get a menu "Import
> DBase Files, Character set" and it offers me a long list of choices,
> including Western Europe (Windows-1252/WinLatin 1); so I selected that one.
>  I open it, then save it.  Use the latest ODF format or Keep Format.  I
> chose Keep Current Format.  I get an error message regarding max number of
> characters and decimal places, 19 and 11, respectively. There are 20
> characters (including the decimal point).  So couldn't save it in the
> current format.

.dbf is normally used for DBase files (or similar database files), but
I don't know if that's true for your files.  I am not sure opening the
files in OpenOffice is a good idea, and saving them again from
OpenOffice is not likely to do any good, and might corrupt the results
too.

I am not familiar with IPostGIS and have not used PgAdmin III, so I'm
not sure how this is meant to work, but I assume they are both GUI
tools and therefore should not be affected by the settings in the
Command Prompt window.

> Clearly I'm on to something regarding this particular data set, if not the
> problem in general.

I'm not convinced :)

> 3.  When I typed cmd.exe chcp 1252, I saw nothing afterwards except the
> message about the activated code page.  Then I navigated to the directory in
> which I find my psql file.  I ran the command psql and was prompted for my
> password, which I understand should be the same as that which I gave when
> installing PostgreSQL.  I got a FATAL:  password authentication failed for
> user "Cristòbal" (except the ò showed up in DOS as a Greater than or Equal

You might need to specify the username to use instead of your Windows
username.  The username for accessing PostgreSQL needn't have anything
to do with the Windows username.

> sign -- When I got my computer, I set it up using the Spanish spelling of my
> name, Cristòbal... and needless to say that has caused a lot of problems.
>  I'll never use a accent marks again for that type of thing).
>
> For now, I'm still stuck at the beginning.  Maybe I should reboot?

Rebooting is unlikely to improve the situation.

> Thanks again,

No problem.  I hope my e-mail helps.

> Chris

--
Michael Wood <esiotrot@gmail.com>