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

Tom Lane <[email protected]> Wed, 21 Nov 2018 13:19:20 -0500
Newsgroups gmane.comp.db.postgresql.sql,gmane.comp.db.postgresql.bugs
Message-ID <[email protected]>
"Voillequin, Jean-Marc" <[email protected]> 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.

			regards, tom lane