pg_user, pg_group and arrays

Поиск
Список
Период
Сортировка
От Evelio Martinez
Тема pg_user, pg_group and arrays
Дата
Msg-id 3A93AB4A.7632270C@testanet.com
обсуждение исходный текст
Список pgsql-general
 
Hi!

I would like if there is any way to retrieve all users in a group in an "elegant way":

Something like the following but without errors:

select usename from pg_user where usesysid in ( select grolist from pg_group);
ERROR:  Unable to identify an operator '=' for types 'int4' and '_int4'
 You will have to retype this query using an explicit cast

Another way :
select usename from pg_user where usesysid in ( select grolist[1] from pg_group where groname='tecnico')
union
select usename from pg_user where usesysid in ( select grolist[2] from pg_group where groname='tecnico')
union
select usename from pg_user where usesysid in ( select grolist[3] from pg_group where groname='tecnico')
union
select usename from pg_user where usesysid in ( select grolist[4] from pg_group where groname='tecnico');

Perhaps a function in SPL ?

TIA

-- 
Evelio Martínez
 

В списке pgsql-general по дате отправления:

Предыдущее
От: brichard@cafod.org.uk (Bruce Richardson)
Дата:
Сообщение: Multiple triggers/rules
Следующее
От: "Neil Burrows"
Дата:
Сообщение: Inheritance Question