On Fri, Feb 3, 2017 at 3:55 AM, Peter Eisentraut <peter.eisentr...@2ndquadrant.com> wrote: > On 2/2/17 12:48 PM, Fujii Masao wrote: >> +#define Query_for_list_of_subscriptions \ >> +" SELECT pg_catalog.quote_ident(subname) "\ >> +" FROM pg_catalog.pg_subscription "\ >> +" WHERE substring(pg_catalog.quote_ident(subname),1,%d)='%s'" >> >> Since non-superuser is not allowed to access to pg_subscription, >> pg_stat_subscription should be accessed here, instead. Thought? > > Arguably, you could leave it like that, assuming it fails cleanly for > nonsuperusers. Nonsuperusers are not going to be able to run any > commands on subscriptions anyway, so there is little use for it.
No. You can get rid of superuser privilege from the owner of the subscription and that nonsuperuser owner can run some commands on the subscriptin. It's a bit artificial, but you can. I'm not sure if we should add the check to prevent the owner from becoming nonsuperuser. But if the owner always must have a superuser privilege per the specification of logical replication, I think that such check would be necessary. Also I prefer to tab-complete the subscriptions even for nonsuperusers. There are some objects that only superuser or owner can manage, but their names are currently tab-completed even when current user is "normal" one. So I'm afraid that handling only subscriptions differently might be more confusing. Regards, -- Fujii Masao -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers