Some notes about PostgreSQL
CREATE OR REPLACE FUNCTION is_superuser(text) RETURNS boolean AS $$ SELECT EXISTS(SELECT 1 FROM pg_roles WHERE rolname = $1 AND rolsuper); $$ LANGUAGE sql; postgres=# SELECT is_superuser('tom'); is_superuser -------------- f (1 row)
No comments:
Post a Comment