Re: Weird "could not determine which collation to use for string comparison" with LEAST/GREATEST on PG11 procedure

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, "Voillequin, Jean-Marc" <Jean-Marc.Voillequin@moodys.com>
Cc: pgsql-bugs@lists.postgresql.org, pgsql-sql@lists.postgresql.org
Date: 2019-02-05T14:11:32Z
Lists: pgsql-bugs, pgsql-sql

Attachments

On 21/11/2018 19:19, Tom Lane wrote:
> "Voillequin, Jean-Marc" <Jean-Marc.Voillequin@moodys.com> writes:
>> SIMPLE=> create or replace procedure same_values_proc(a text, b text) as $body$
>> SIMPLE$> begin
>> SIMPLE$>        assert a = b;
>> SIMPLE$> end;$body$ language plpgsql;
>> CREATE PROCEDURE
>> SIMPLE=>
>> SIMPLE=> call same_values_proc(least('a','b'),'a');
>> ERROR:  could not determine which collation to use for string comparison
>> HINT:  Use the COLLATE clause to set the collation explicitly.
> 
> Yeah, same here.  I think somebody forgot to run assign_expr_collations()
> on CALL arguments.

This appears to fix it.

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

Commits

  1. Add collation assignment to CALL statement