Re: parray_gin and \d errors in PG10

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: parray_gin and \d errors in PG10
Date: 2017-10-22 18:36:12
Message-ID: 26962.1508697372@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> After installing parray_gin extension and pg_upgrading another instance,
> \d is failing like so:

> [pryzbyj(at)database ~]$ psql ts -c '\d pg_class'
> ERROR: operator is not unique: "char"[] @> unknown
> LINE 6: (stxkind @> '{d}') AS ndist_enabled,

Ugh.

> Thankfully this is still working:
> ts=# \do @>
> ...
> pg_catalog | @> | anyarray | anyarray | boolean | contains
> ...
> public | @> | text[] | text[] | boolean | text array contains compared by strict

I'm inclined to think it wasn't very bright of parray_gin to have
installed an operator that's confusable with the builtin anyarray @>
anyarray operator. Still, we might as well try to work around that.

> This query works fine when adding cast to text[]:

No, that will fail entirely if you don't have parray_gin installed,
because stxkind is of type "char"[], and "char"[] @> text[] will not
match the anyarray operator. Possibly we could use

(stxkind @> '{d}'::pg_catalog."char"[])

That works for me without parray_gin installed, but I wonder whether
it fails due to ambiguity if you do have parray_gin installed. In
principle this'd still match the text[] @> text[] operator, and I'm
not sure whether we have an ambiguity resolution rule that would
prefer one over the other.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin Pryzby 2017-10-22 18:41:14 Re: parray_gin and \d errors in PG10
Previous Message Justin Pryzby 2017-10-22 18:15:25 parray_gin and \d errors in PG10