Re: [SQL] usernames of a group from SQL

2006-05-21 Thread Markus Schaber
Hi, Kijato, kijato schrieb: > 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; The pg_user.usernam

Re: [SQL] usernames of a group from SQL

2006-05-21 Thread kijato
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"

Re: [SQL] usernames of a group from SQL

2006-05-19 Thread Achilleus Mantzios
O Kis Jαnos Tamαs έγραψε στις May 19, 2006 : > Hi, > > At the first time: I'm in newbie in SQL... I'm sorry! > > My question is: How can I get the usernames of a group (for example > 'osztatlan_users') from SQL? > > I try it: > > SELECT usename > FROM pg_user > WHERE usesysid IN (SELECT groli

[SQL] usernames of a group from SQL

2006-05-19 Thread Kis János Tamás
Hi, At the first time: I'm in newbie in SQL... I'm sorry! My question is: How can I get the usernames of a group (for example 'osztatlan_users') from SQL? I try it: SELECT usename FROM pg_user WHERE usesysid IN (SELECT grolist FROM pg_group WHERE groname='osztatlan_users') ORDER BY pg_user;