Re: usernames of a group from SQL - Mailing list pgsql-sql

From kijato
Subject Re: usernames of a group from SQL
Date
Msg-id 200605211004.30969.kijato@gmail.com
Whole thread Raw
In response to Re: usernames of a group from SQL  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Responses Re: usernames of a group from SQL
List pgsql-sql
On Friday May 19 2006 12.04, Achilleus Mantzios wrote:
>
> SELECT u.usename from pg_user u,pg_group g where u.usesysid = any
> (g.grolist) and g.groname='osztatlan_users';
>

I'd like to make a function with this SQL:

CREATE FUNCTION kodok.group_users(group_name "varchar")
RETURNS SETOF "varchar" AS
$BODY$
SELECT pg_user.usename
FROM pg_user, pg_group
WHERE usesysid = any (pg_group.grolist) AND pg_group.groname=$1;
$BODY$
LANGUAGE 'sql' VOLATILE;

But I get the next error message:

ERROR:  return type mismatch in function declared to return character 
varying
DETAIL:  Actual return type is name.
CONTEXT:  SQL function "group_users"

At the moment, I don't understand what is the problem, and what I need 
to do now...?

Thanks,
kjt

____________________________________________________________________
Nagyobb szabadsαgra vαgysz? Tφrj ki a nιgy fal kφzόl!
Start ADSL elυfizetιsedhez az EuroWeb mostantσl havi 100 perc ingyenes WiFi hozzαfιrιst biztosνt szαmodra.
Rιszletek: www.freestart.hu



pgsql-sql by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: timestamp query doesn't use an index ...
Next
From: Markus Schaber
Date:
Subject: Re: usernames of a group from SQL