Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: usernames of a group from SQL



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.username column uses the PostgreSQL internal type "name"
which is used for identifiers like table and user names. The PostgreSQL
Documentation contains more about this.

I think you can cast it to varchar, like:

SELECT pg_user.username::varchar


HTH,
Markus




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group