Re: usernames of a group from SQL

From: kijato <kijato(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: usernames of a group from SQL
Date: 2006-05-21 08:04:30
Message-ID: 200605211004.30969.kijato@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Schaber 2006-05-21 10:34:10 Re: usernames of a group from SQL
Previous Message Marc G. Fournier 2006-05-21 02:26:37 Re: timestamp query doesn't use an index ...