Hello hanckers,
We use this simple function to workaround citext=text behavior.
create extension citext;
CREATE FUNCTION citext_eq( citext, text )
RETURNS bool
AS 'citext'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR = (
LEFTARG= CITEXT,
RIGHTARG = TEXT,
COMMUTATOR = =,
NE
>
>
>> Thanks for the input. It's worth noting that the equality operator
>> currently works in the same way: citext = text comparison is (surprisingly
>> for me) case-sensitive.
>>
>> My expectation was that since citext is supposed to be a case-insensitive
>> *type*, all comparison operations inv
On Sunday, May 6, 2018, Shay Rojansky wrote:
>
>
> Thanks for the input. It's worth noting that the equality operator
> currently works in the same way: citext = text comparison is (surprisingly
> for me) case-sensitive.
>
> My expectation was that since citext is supposed to be a case-insensitive
>
> > Do you think it would be appropriate to simply add an strpos(citext,
> text)
> > overload to the extension to make sure this behaves more as expected? If
> so
> > I can try to submit a patch at some point.
>
> To me, if there's both a citext and a text parameter, then it's simply
> unclear wh
Shay Rojansky writes:
> Do you think it would be appropriate to simply add an strpos(citext, text)
> overload to the extension to make sure this behaves more as expected? If so
> I can try to submit a patch at some point.
To me, if there's both a citext and a text parameter, then it's simply
uncl
2018-05-06 14:55 GMT+02:00 Shay Rojansky :
> Thanks for your answer Pavel.
>
> This is expected - it is side effect of PostgreSQL implementation of
>> function overloading and type conversions
>>
>> after installation citext, you will have more instances of function strpos
>>
>> strpos(citext, cit
Thanks for your answer Pavel.
This is expected - it is side effect of PostgreSQL implementation of
> function overloading and type conversions
>
> after installation citext, you will have more instances of function strpos
>
> strpos(citext, citext)
> strpos(text, text)
>
Do you think it would be
2018-05-06 8:26 GMT+02:00 Shay Rojansky :
> Hi hackers.
>
> The following works well of course:
>
> test=# select strpos('Aa'::citext, 'a');
> strpos
>
> 1
>
> However, if I pass a typed text parameter for the substring, I get
> case-sensitive behavior instead:
>
> test=# select st
Hi hackers.
The following works well of course:
test=# select strpos('Aa'::citext, 'a');
strpos
1
However, if I pass a typed text parameter for the substring, I get
case-sensitive behavior instead:
test=# select strpos('Aa'::citext, 'a'::text);
strpos
2
This see