Re: execute prepared statement passing parameter expression with COLLATE clause - Mailing list pgsql-hackers

From Tom Lane
Subject Re: execute prepared statement passing parameter expression with COLLATE clause
Date
Msg-id 2458353.1729780447@sss.pgh.pa.us
Whole thread Raw
In response to execute prepared statement passing parameter expression with COLLATE clause  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
jian he <jian.universality@gmail.com> writes:
> select * from pktable where x = 'Å' collate ignore_accents;
> --return one row

> execute q6('Å' collate ignore_accents);
> --return zero rows

> not sure return zero rows is desired.


The parameter symbol just represents a value, which does not
carry any collation information.  The collation to use was
determined when the prepared statement was parsed, and is not
going to change on the basis of what you write in EXECUTE.
We could have a discussion about whether this is desirable,
but it's prett much moot, because this is how the SQL committee
designed SQL's collation feature.  It's not going to change.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Junwang Zhao
Date:
Subject: Re: general purpose array_sort
Next
From: Fujii Masao
Date:
Subject: Re: Fix for consume_xids advancing XIDs incorrectly