pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wangw.fnst@fujitsu.com <wangw.fnst@fujitsu.com>
To: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: An omission of automatic completion in tab-complete.c
Date: Tue, 20 Apr 2021 03:28:38 +0000
Message-ID: <OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com> (raw)

There is an omission of automatic completion of CURRENT_ROLE in tab-complete.c.

Best wishes,
Wei Wang

Attachments:

An-omission-of-automatic-completion-of-CURRENT_ROLE.patch (application/octet-stream, 1.5K) download From 1146ea8fcdfdeccd27f1965f44dd2a220a068ccb Mon Sep 17 00:00:00 2001 From: wangw <wangw.fnst@fujitsu.com> Date: Mon, 12 Apr 2021 08:59:12 +0800 Subject: [PATCH] An omission of automatic completion of CURRENT_ROLE in tab-complete.c --- src/bin/psql/tab-complete.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 3a43c09bf6..ab8404fce3 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -744,6 +744,7 @@ static const SchemaQuery Query_for_list_of_statistics = { " FROM pg_catalog.pg_roles "\ " WHERE substring(pg_catalog.quote_ident(rolname),1,%d)='%s'"\ " UNION ALL SELECT 'PUBLIC'"\ +" UNION ALL SELECT 'CURRENT_ROLE'"\ " UNION ALL SELECT 'CURRENT_USER'"\ " UNION ALL SELECT 'SESSION_USER'" @@ -3339,7 +3340,7 @@ psql_completion(const char *text, int start, int end) /* * Complete "GRANT/REVOKE ... TO/FROM" with username, PUBLIC, - * CURRENT_USER, or SESSION_USER. + * CURRENT_ROLE, CURRENT_USER, or SESSION_USER. */ else if ((HeadMatches("GRANT") && TailMatches("TO")) || (HeadMatches("REVOKE") && TailMatches("FROM"))) @@ -3758,6 +3759,7 @@ psql_completion(const char *text, int start, int end) COMPLETE_WITH("FOR"); else if (Matches("CREATE", "USER", "MAPPING", "FOR")) COMPLETE_WITH_QUERY(Query_for_list_of_roles + " UNION SELECT 'CURRENT_ROLE'" " UNION SELECT 'CURRENT_USER'" " UNION SELECT 'PUBLIC'" " UNION SELECT 'USER'"); -- 2.23.0.windows.1

view thread (4+ messages)  latest in thread

Message-ID: <OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com>
Permalink:  ../OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: wangw.fnst@fujitsu.com
  Subject: Re: An omission of automatic completion in tab-complete.c
  In-Reply-To: <OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com>
  References: <OS3PR01MB6275935F62E161BCD393D6559E489@OS3PR01MB6275.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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