Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/srv/db/postgres/sql/activate-user.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE PROCEDURE teleport_activate_user(username varchar, roles varchar[])
CREATE OR REPLACE PROCEDURE pg_temp.teleport_activate_user(username varchar, roles varchar[])
LANGUAGE plpgsql
AS $$
DECLARE
Expand All @@ -25,7 +25,7 @@ BEGIN
-- Otherwise reactivate the user, but first strip if of all roles to
-- account for scenarios with left-over roles if database agent crashed
-- and failed to cleanup upon session termination.
CALL teleport_deactivate_user(username);
CALL pg_temp.teleport_deactivate_user(username);
EXECUTE FORMAT('ALTER USER %I WITH LOGIN', username);
ELSE
EXECUTE FORMAT('CREATE USER %I IN ROLE "teleport-auto-user"', username);
Expand Down
2 changes: 1 addition & 1 deletion lib/srv/db/postgres/sql/deactivate-user.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE PROCEDURE teleport_deactivate_user(username varchar)
CREATE OR REPLACE PROCEDURE pg_temp.teleport_deactivate_user(username varchar)
LANGUAGE plpgsql
AS $$
DECLARE
Expand Down
4 changes: 2 additions & 2 deletions lib/srv/db/postgres/sql/delete-user.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE PROCEDURE teleport_delete_user(username varchar, inout state varchar default 'TP003')
CREATE OR REPLACE PROCEDURE pg_temp.teleport_delete_user(username varchar, inout state varchar default 'TP003')
LANGUAGE plpgsql
AS $$
DECLARE
Expand All @@ -15,7 +15,7 @@ BEGIN
state := 'TP004';
-- Drop user/role will fail if user has dependent objects.
-- In this scenario, fallback into disabling the user.
CALL teleport_deactivate_user(username);
CALL pg_temp.teleport_deactivate_user(username);
END;
END IF;
END;$$;
Loading