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

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Voillequin, Jean-Marc" <Jean-Marc(dot)Voillequin(at)moodys(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: Weird "could not determine which collation to use for string comparison" with LEAST/GREATEST on PG11 procedure
Date: 2019-02-05 14:11:32
Message-ID: 66209b1a-db5b-d578-6674-1be789c581f5@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-sql

On 21/11/2018 19:19, Tom Lane wrote:
> "Voillequin, Jean-Marc" <Jean-Marc(dot)Voillequin(at)moodys(dot)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

Attachment Content-Type Size
0001-Add-collation-assignment-to-CALL-statement.patch text/plain 2.3 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-02-05 14:46:27 Re: Weird "could not determine which collation to use for string comparison" with LEAST/GREATEST on PG11 procedure
Previous Message Peter Eisentraut 2019-02-05 11:28:44 Re: BUG #15511: Drop table error "invalid argument"

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2019-02-05 14:46:27 Re: Weird "could not determine which collation to use for string comparison" with LEAST/GREATEST on PG11 procedure
Previous Message Sven Berkvens-Matthijsse 2019-02-04 16:19:29 Re: Idea: INSERT INTO ... NATURAL SELECT ...