v0-0002-change-pw.patch
text/x-patch
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch v0-0002
| File | + | − |
|---|---|---|
| src/bin/psql/command.c | 0 | 0 |
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 82cc091..a581b52 100644
*** a/src/bin/psql/command.c
--- b/src/bin/psql/command.c
*************** exec_command_password(PsqlScanState scan
*** 2158,2186 ****
}
else
{
! char *encrypted_password;
!
! encrypted_password = PQencryptPasswordConn(pset.db, pw1, user, NULL);
!
! if (!encrypted_password)
! {
pg_log_info("%s", PQerrorMessage(pset.db));
- success = false;
- }
- else
- {
- PGresult *res;
-
- printfPQExpBuffer(&buf, "ALTER USER %s PASSWORD ",
- fmtId(user));
- appendStringLiteralConn(&buf, encrypted_password, pset.db);
- res = PSQLexec(buf.data);
- if (!res)
- success = false;
- else
- PQclear(res);
- PQfreemem(encrypted_password);
- }
}
free(user);
--- 2158,2166 ----
}
else
{
! success = PQchangePassword(pset.db, pw1, user, NULL);
! if (!success)
pg_log_info("%s", PQerrorMessage(pset.db));
}
free(user);