2

When executing this postgres command:

EXECUTE 'CREATE USER myuser WITH UNENCRYPTED PASSWORD ''my+password''';

I see the error:

RoundhousE encountered an error.
Npgsql.PostgresException (0x80004005): 0A000: UNENCRYPTED PASSWORD is no longer supported

Is there a workaround for this, or will the password need to be manually encrypted and supplied without the UNENCRYPTED keyword?

dahui
  • 2,128
  • 2
  • 21
  • 40

2 Answers2

2

No. All you have to do is to omit the UNENCRYPTED.

You can supply both encrypted and unencrypted passwords that way, and PostgreSQL can tell the difference automatically.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • Thanks for the answer. I did omit the keyword but then was still getting errors when authenticating to the database via the same connection string. Would the password remain the same when logging in, assuming I removed UNENCRYPTED, but left the password value the same? – dahui Jun 06 '18 at 08:52
  • Sure, you can use that very same password to log into the database. Consult the PostgreSQL log to see the reason for your authentication failure. – Laurenz Albe Jun 06 '18 at 08:55
  • I'll try and log in again and get back to accept this answer! thanks – dahui Jun 06 '18 at 09:00
1

PostgreSQL 10+ no longer support user creation with UNENCRYPTED password, create it with ENCRYPTED:

CREATE USER myuser WITH ENCRYPTED PASSWORD ''my+password''
niainaLens
  • 781
  • 7
  • 5