Created
August 11, 2024 17:43
-
-
Save Dadangdut33/0b1af533439a451c303b8434c6eff6de to your computer and use it in GitHub Desktop.
Add pooler connection to newly created database in tembo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRANT CONNECT ON DATABASE db_name_here TO cnpg_pooler_pgbouncer; | |
CREATE OR REPLACE FUNCTION user_search(uname TEXT) | |
RETURNS TABLE (usename name, passwd text) | |
LANGUAGE sql SECURITY DEFINER AS | |
'SELECT usename, passwd FROM pg_shadow WHERE usename=$1;'; | |
REVOKE ALL ON FUNCTION user_search(text) | |
FROM public; | |
GRANT EXECUTE ON FUNCTION user_search(text) | |
TO cnpg_pooler_pgbouncer; | |
ALTER FUNCTION user_search(TEXT) OWNER TO postgres; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment