pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedQuery on pg_settings view
3+ messages / 3 participants
[nested] [flat]
* Query on pg_settings view
@ 2017-11-15 09:17 Ronen Nofar <ronennofar@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Ronen Nofar @ 2017-11-15 09:17 UTC (permalink / raw)
To: pgsql-general
Hi,
I have a weird case when running a query on the pg_settings view.
I have two users, first one is the default user - postgres which is a
superuser and another one is a role which i had created, i called it
test_role and it's not a superuser.
When I run a select on pg_settings with these two users I recieve different
results.
Running the query 'select * from pg_settings' with 'postgres' user returns
269 rows when running the same query with 'test_role' returns 254 rows.
For example, the following query 'select lower(setting) from pg_settings
where lower(name) = 'config_file'' returns null when I connect with
'test_role' but with 'postgres' user I recieve one row
(/var/lib/pgsql/9.6/data/postgresql.conf).
I have granted all privileges on pg_settings to 'test_role' but it didn't
changed the results.
I don't have any idea what it's wrong here.
The PostgreSQL version is PostgreSQL 9.6.1 on x86_64-pc-linux-gnu
Can you please help me with this issue?
Thanks in advance,
Ronen
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Query on pg_settings view
@ 2017-11-15 10:16 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Ronen Nofar <ronennofar@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Laurenz Albe @ 2017-11-15 10:16 UTC (permalink / raw)
To: Ronen Nofar <ronennofar@gmail.com>; pgsql-general
Ronen Nofar wrote:
> I have a weird case when running a query on the pg_settings view.
> I have two users, first one is the default user - postgres which is a superuser
> and another one is a role which i had created, i called it test_role and it's not a superuser.
> When I run a select on pg_settings with these two users I recieve different results.
That is intentional, because some settings should only be
visible for superusers, for example everything that has to
do with the operating system (location of configuration file
or socket directories).
Yours,
Laurenz Albe
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Query on pg_settings view
@ 2017-11-15 11:19 Stephen Frost <sfrost@snowman.net>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Frost @ 2017-11-15 11:19 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Ronen Nofar <ronennofar@gmail.com>; pgsql-general
Greetings,
* Laurenz Albe (laurenz.albe@cybertec.at) wrote:
> Ronen Nofar wrote:
> > I have a weird case when running a query on the pg_settings view.
> > I have two users, first one is the default user - postgres which is a superuser
> > and another one is a role which i had created, i called it test_role and it's not a superuser.
> > When I run a select on pg_settings with these two users I recieve different results.
>
> That is intentional, because some settings should only be
> visible for superusers, for example everything that has to
> do with the operating system (location of configuration file
> or socket directories).
This isn't quite correct any longer- with PG10, we have a default role
called 'pg_read_all_settings' which can be GRANT'd to other roles to
allow viewing of all settings, even those previously restricted to
superuser-only.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-11-15 11:19 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-15 09:17 Query on pg_settings view Ronen Nofar <ronennofar@gmail.com>
2017-11-15 10:16 ` Laurenz Albe <laurenz.albe@cybertec.at>
2017-11-15 11:19 ` Stephen Frost <sfrost@snowman.net>
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