From 01170b5b995de8d67fe6f443ca57ae75e2008989 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 21 Nov 2024 21:47:25 +0100 Subject: [PATCH] chore(postgres): reenable user login with password --- snippets/postgres/primer.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/snippets/postgres/primer.sql b/snippets/postgres/primer.sql index cf6f305..90bf888 100644 --- a/snippets/postgres/primer.sql +++ b/snippets/postgres/primer.sql @@ -140,6 +140,18 @@ ALTER ROLE samantha WITH PASSWORD 'Wing5+Trunks3+Relic2' VALID UNTIL 'August 4 1 -- Change password's validity ALTER ROLE fred VALID UNTIL 'infinity'; +ALTER ROLE samantha VALID UNTIL 'August 4 12:00:00 2024 +1'; + +-- Reset password expiration date to NULL +UPDATE pg_authid SET rolvaliduntil = NULL WHERE rolname == 'lucas'; +-- For everybody +UPDATE pg_authid +SET rolvaliduntil = NULL +WHERE rolname IN ( + SELECT rolname + FROM pg_authid + WHERE rolvaliduntil IS NOT NULL +); -- Rename roles ALTER ROLE manager RENAME TO boss;