A function which returns all rolname from pg_roles.

From: "Karen Hill" <karen_hill22(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: A function which returns all rolname from pg_roles.
Date: 2006-07-11 02:27:38
Message-ID: 1152584858.269723.115320@h48g2000cwc.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How do I make this function work? I am trying to get all the rolnames
from pg_roles.

CREATE OR REPLACE FUNCTION test() SETOF name AS $$
DECLARE
rrol name;
BEGIN
SELECT rolname INTO rrol FROM pg_roles;
RETURN setof rrol;
END;
$$ LANGUAGE plpgsql;

regards,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-07-11 03:46:49 Re: US Telephone Number Type
Previous Message Alex Turner 2006-07-11 02:00:47 Re: Notes on converting from MySQL 5.0.x to PostgreSQL