ayrıcalıkları gösterilen ile bu sorgu, (spesifik veri tabanları, şemalar veya tabloların filtrelemek için WHERE
maddesi olarak hat (lar) ni) veri tabanları ve şemaların tüm tüm tabloları listeler
SELECT grantee
,table_catalog
,table_schema
,table_name
,string_agg(privilege_type, ', ' ORDER BY privilege_type) AS privileges
FROM information_schema.role_table_grants
WHERE grantee != 'postgres'
-- and table_catalog = 'somedatabase' /* uncomment line to filter database */
-- and table_schema = 'someschema' /* uncomment line to filter schema */
-- and table_name = 'sometable' /* uncomment line to filter table */
GROUP BY 1, 2, 3, 4;
Örnek çıktı:
grantee |table_catalog |table_schema |table_name |privileges |
--------|----------------|--------------|---------------|---------------|
PUBLIC |adventure_works |pg_catalog |pg_sequence |SELECT |
PUBLIC |adventure_works |pg_catalog |pg_sequences |SELECT |
PUBLIC |adventure_works |pg_catalog |pg_settings |SELECT, UPDATE |
...
Eğer sql bölmesinde veya pg komut satırından doğrudan bu aday olacağını belirli bir ayrıcalık verilmesi halinde görmek kolay olmadığını böylece sipariş? –
@ DanielL.VanDenBosch: '\ z' gibi tüm meta komutları psql içindir. Ve psql, PostgreSQL'in komut satırı arabirimidir. –