0

I have a project in C# using DavArt dotConnector to connect to PostgreSQL database. In database I can add role to use it in connection string.

CREATE ROLE "Z111222333";
ALTER ROLE "Z111222333" WITH NOCREATEROLE LOGIN PASSWORD 'md5c6fd41ba62fc5ce98135f0707de385ba';

With Latin characters in the name all goes right. User can connect.
I try to create role with non-Latin characters (e.g. Cyrillic).

CREATE ROLE "ZФРОЛОВМ";
ALTER ROLE "ZФРОЛОВМ" WITH NOCREATEROLE LOGIN PASSWORD 'md5b4b194033aab1f2d6dbd275736f1b029';

In this case user can't connect. Exception: "Error: 28P01: password authentication failed for user "ZФРОЛОВМ"".

Connector: Devart dotConnector for PostgreSQL 6.5
Database: PostgreSQL 9.1
Connection string: "User Id=ZФРОЛОВМ;Password=A1E0476879CAB2A76CC22C80BBF364; Host=localhost;Database=testDB;Unicode=True;Persist Security Info=True;Schema=mir"

How can I use non-Latin characters in the UserId?

2
  • 1
    Are you sure the password is right?
    – JMK
    Commented Oct 30, 2013 at 12:54
  • Sorry.I am sure that in my database password is correct. But in this example I have a mistake: ALTER ROLE "ZФРОЛОВМ" WITH NOCREATEROLE LOGIN PASSWORD 'md517aa59c10d0061a2d179831df43902f6';
    – Roren
    Commented Oct 31, 2013 at 7:03

1 Answer 1

0

Using non-ASCII characters in user names (and database names) is best avoided in PostgreSQL. During the initial connection setup and authentication, character encoding conversion is not active, and the success of the connection will then depend on whether you happen to send the right bytes in the right encoding. I don't know whether that's the problem in your case, but it wouldn't surprise me, and it wouldn't surprise me if there are other similar problems.

1
  • Thank you. I will use this as a best practice.
    – Roren
    Commented Oct 31, 2013 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.