pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kijato <kijato@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: usernames of a group from SQL
Date: Sun, 21 May 2006 10:04:30 +0200
Message-ID: <200605211004.30969.kijato@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0605191304380.3491-100000@matrix.gatewaynet.com>
References: <Pine.LNX.4.44.0605191304380.3491-100000@matrix.gatewaynet.com>

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




view thread (4+ messages)  latest in thread

Message-ID: <200605211004.30969.kijato@gmail.com>
Permalink:  ../200605211004.30969.kijato@gmail.com/
Also on:    postgresql.org/message-id/200605211004.30969.kijato@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kijato@gmail.com
  Subject: Re: usernames of a group from SQL
  In-Reply-To: <200605211004.30969.kijato@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox