aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-10-22 16:45:16 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-10-22 16:45:26 -0400
commit852e3224e76e55f7e2046643d98d7d0786439a9c (patch)
tree709d72c263c681fcf63211ede2224bf5a82ca9cd /src
parent7a5f8de5525a861af5917c73e78efe15ea3e1bb2 (diff)
downloadpostgresql-852e3224e76e55f7e2046643d98d7d0786439a9c.tar.gz
postgresql-852e3224e76e55f7e2046643d98d7d0786439a9c.zip
Adjust psql \d query to avoid use of @> operator.
It seems that the parray_gin extension has seen fit to introduce a "text[] @> text[]" operator, which conflicts with the core "anyarray @> anyarray" operator, causing ambiguous-operator failures if the input arguments are coercible to text[] without being exactly that type. This strikes me as a bad idea, but it's out there and people use it. As of v10, that breaks psql's query that tries to test "pg_statistic_ext.stxkind @> '{d}'", since stxkind is char[]. The best workaround seems to be to avoid use of that operator. We can use a scalar-vs-array test "'d' = any(stxkind)" instead; that's arguably more readable anyway. Per report from Justin Pryzby. Backpatch to v10 where this query was added. Discussion: https://postgr.es/m/20171022181525.GA21884@telsasoft.com
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/describe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 019aa844f4d..70548d828b0 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2417,8 +2417,8 @@ describeOneTableDetails(const char *schemaname,
" FROM pg_catalog.unnest(stxkeys) s(attnum)\n"
" JOIN pg_catalog.pg_attribute a ON (stxrelid = a.attrelid AND\n"
" a.attnum = s.attnum AND NOT attisdropped)) AS columns,\n"
- " (stxkind @> '{d}') AS ndist_enabled,\n"
- " (stxkind @> '{f}') AS deps_enabled\n"
+ " 'd' = any(stxkind) AS ndist_enabled,\n"
+ " 'f' = any(stxkind) AS deps_enabled\n"
"FROM pg_catalog.pg_statistic_ext stat "
"WHERE stxrelid = '%s'\n"
"ORDER BY 1;",