Re: cache lookup failed for collation 0 - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: cache lookup failed for collation 0
Date
Msg-id 787c1825-49f6-2c41-20cb-3252c7ee44e7@2ndquadrant.com
Whole thread Raw
In response to cache lookup failed for collation 0  (Jeevan Chalke <jeevan.chalke@enterprisedb.com>)
Responses Re: cache lookup failed for collation 0
List pgsql-hackers
On 2019-04-11 17:04, Jeevan Chalke wrote:
> The error is coming from get_collation_isdeterministic() when colloid
> passed is 0. I think like we do in get_collation_name(), we should
> return false here when such collation oid does not exist.

I'm not in favor of doing that.  It would risk papering over errors of
omission at other call sites.

The root cause is that the same code match_pattern_prefix() is being
used for text and bytea, but bytea does not use collations, so having
the collation 0 is expected, and we shouldn't call
get_collation_isdeterministic() in that case.

Proposed patch attached.

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

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: REINDEX CONCURRENTLY 2.0
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH v20] GSSAPI encryption support