aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-03-10 13:18:21 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-03-10 13:18:21 -0500
commitb6e132ddc8601c99ac5466792f6128ee859f4128 (patch)
tree6ea2e56969a18430be8e10f55a5ee7db787fc7df
parent5748f3a0aa7cf78ac6979010273bd9d50869bb8e (diff)
downloadpostgresql-b6e132ddc8601c99ac5466792f6128ee859f4128.tar.gz
postgresql-b6e132ddc8601c99ac5466792f6128ee859f4128.zip
In psql, restore old behavior of Query_for_list_of_functions.
Historically, tab completion for functions has offered the names of aggregates as well. This is essential in at least one context, namely GRANT/REVOKE, because there is no GRANT ON AGGREGATE syntax. There are other cases where a command that nominally is for functions will allow aggregates as well, though not all do. Commit fd1a421fe changed this query to disallow aggregates, but that doesn't seem to have been thought through very carefully. Change it to allow aggregates (but still ignore procedures). We might at some point tighten this up, but it'd require sorting through all the uses of this query to see which ones should offer aggregate names and which shouldn't. Given the lack of field complaints about the historical laxity here, that's work I'm not eager to do right now. Discussion: https://postgr.es/m/14268.1520283126@sss.pgh.pa.us
-rw-r--r--src/bin/psql/tab-complete.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 340febedb97..08d8ef09a4c 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -461,6 +461,7 @@ static const SchemaQuery Query_for_list_of_domains = {
NULL
};
+/* Note: this intentionally accepts aggregates as well as plain functions */
static const SchemaQuery Query_for_list_of_functions[] = {
{
/* min_server_version */
@@ -468,7 +469,7 @@ static const SchemaQuery Query_for_list_of_functions[] = {
/* catname */
"pg_catalog.pg_proc p",
/* selcondition */
- "p.prokind IN ('f', 'w')",
+ "p.prokind != 'p'",
/* viscondition */
"pg_catalog.pg_function_is_visible(p.oid)",
/* namespace */