Re: Provide list of subscriptions and publications in psql's completion

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Provide list of subscriptions and publications in psql's completion
Date: 2017-02-02 18:55:38
Message-ID: fb8e8918-b307-85b5-c1d2-182f56c80818@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-02-02 18:56:16 Re: Provide list of subscriptions and publications in psql's completion
Previous Message Peter Eisentraut 2017-02-02 18:48:28 Re: Enabling replication connections by default in pg_hba.conf