postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+---------------------
abc | Cannot login | {}
d | Cannot login | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
ro | | {pg_read_all_data}
rw | | {pg_write_all_data}
postgres=# alter role abc login;
ALTER ROLE
postgres=# create or replace function hello(int) returns void as $$
postgres$# declare
postgres$# begin
postgres$# perform 1 from pg_class;
postgres$# perform $1+$1;
postgres$# end;
postgres$# $$ language plpgsql strict;
CREATE FUNCTION
postgres=# select hello(1);
hello
-------
(1 row)
postgres=# \c postgres abc
You are now connected to database "postgres" as user "abc".
postgres=> select * from pg_proc where proname='hello';
-[ RECORD 1 ]---+---------------------------
oid | 376507
proname | hello
pronamespace | 354435
proowner | 10
prolang | 14228
procost | 100
prorows | 0
provariadic | 0
prosupport | -
prokind | f
prosecdef | f
proleakproof | f
proisstrict | t
proretset | f
provolatile | v
proparallel | u
pronargs | 1
pronargdefaults | 0
prorettype | 2278
proargtypes | 23
proallargtypes |
proargmodes |
proargnames |
proargdefaults |
protrftypes |
prosrc | +
| declare +
| begin +
| perform 1 from pg_class;+
| perform $1+$1; +
| end; +
|
probin |
prosqlbody |
proconfig |
proacl |