MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.24k stars 21.41k forks source link

curl statement issue and UTF-8 encoding issue #31546

Closed jjfrost closed 5 years ago

jjfrost commented 5 years ago

Couple of further items to consider updating in this article:

1.) From the psql command prompt, the curl command such as in [! curl -O https://examples.citusdata.com/users.csv] results in "permission denied" error . Workaround is to download this file locally, then run the \copy command pointing to the local downloaded file path in the from statement as in: [\copy github_users from 'c:\mydata\users.csv' WITH CSV]

2.) If running a command prompt in Windows to run psql command, you need to set the CLIENT_ENCODING to 'utf8' before running the copy commands. If you do not, the copy command for events.csv [\copy github_events from 'events.csv' WITH CSV] will result in an error [ERROR: character with byte sequence 0x8f in encoding "WIN1252" has no equivalent in encoding "UTF8"]


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mimckitt commented 5 years ago

Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.

jjfrost commented 5 years ago

Cool, thanks Micah! I should have mentioned that for #2 in my first comment, the command for the client encoding needed is:

SET CLIENT_ENCODING TO 'utf8';

This worked to solve the error I mentioned by running it before the /copy commands.

jonels-msft commented 5 years ago

@jjfrost thanks, I'll test your suggestions and update the docs.

On my machine the default psql client_encoding is UTF8, so I overlooked the problem. Just out of curiosity, is WIN1252 the default value on your machine?

jjfrost commented 5 years ago

@jonels-msft Great, thanks so much. Yes, correct, WIN1252 was the default upon install of psql and PostgreSQL client tools on my machine. My OS is Windows 10 Enterprise (version 1809) and my PostgreSQL client tools version is 11.3 (64 Bit).

Mike-Ubezzi-MSFT commented 5 years ago

@jonels-msft Want to follow-up on this item to see if the client_encoding detail has been added to the document?

JasonWHowell commented 5 years ago

@Mike-Ubezzi-MSFT I remember from email that @craigkerstiens is the docs backup contact for Joe.

Looks like there are two issues reported on this same article - #31719 and #31546

Thanks, Jason

jonels-msft commented 5 years ago

1.) From the psql command prompt, the curl command such as in [! curl -O https://examples.citusdata.com/users.csv] results in "permission denied" error .

Interesting, the following commands worked for me when I ran them in psql from the Windows 10 Command Prompt application:

\! curl -O https://examples.citusdata.com/users.csv
\! curl -O https://examples.citusdata.com/events.csv

2.) If running a command prompt in Windows to run psql command, you need to set the CLIENT_ENCODING to 'utf8' before running the copy commands.

Yep, confirmed that this worked for me on windows as well. I'll add that to the quickstart before the \copy commands.

jonels-msft commented 5 years ago

@jjfrost can you give me more information about the permission denied error you encountered? I have a few questions above about it.