Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
262 views
in Technique[技术] by (71.8m points)

database - Why does connection to my posgreSQL server in Azure fails?

I've problem here, I've been trying to load data in my postgreSQL Database, by using

psql -h suggestedorder.postgres.database.azure.com -d remote_mydb -U dev_ext@suggestedorder -c "copy planning.PRUEBA (CENTRO, ALMACEN, FECHA_CARGA)  from 'C:Usersgeradiaz.MODELODesktopEnvaseSelección_EnvaseInputsNo_SeleccionadoPRUEBA.csv' with delimiter as ','

Somehow after type this sentence CMD ask for a password:

enter image description here

But when I try to enter my password it just doesn't work, I can't type anything, so I push enter and it shows the next message "Unable to connect to server: FATAL: SSL connection is required. Please specify SSL options and retry."

enter image description here

Do you know guys if there is any way to make it? or How can I specify SSL options without disable them in azure?

question from:https://stackoverflow.com/questions/65942179/why-does-connection-to-my-posgresql-server-in-azure-fails

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

But when I try to enter my password it just doesn't work, I can't type anything,

You don't get any feedback as you enter your password. You just have to take it on faith that your keyboard is working.

so I push enter and it shows the next message "Unable to connect to server: FATAL: SSL connection is required. Please specify SSL options and retry."

Actually the next message you got was "password authentication failed". I guess because you panicked when you noticed you weren't getting feedback, and so you never finished typing the password. (Also, "Unable to connect to server" doesn't appear in your screenshot at all, just the SSL part does)

Once psql's attempt to connect over SSL failed due to the password issue, it decided to try again without SSL. But the server rejected this attempt, leading to the 2nd error message (I don't know what caused the exact wording of that error message, it is not a wording I have seen before). If you set PGSSLMODE=require, then it won't bother to make this 2nd attempt, leading to cleaner error output.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...