Re: BUG #5364: citext behavior when type not in public schema - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: BUG #5364: citext behavior when type not in public schema
Date
Msg-id 201006030305.o5335Cn15945@momjian.us
Whole thread Raw
In response to Re: BUG #5364: citext behavior when type not in public schema  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: BUG #5364: citext behavior when type not in public schema  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #5364: citext behavior when type not in public schema  (Markus Wichitill <mawic@gmx.de>)
List pgsql-bugs
Robert Haas wrote:
> On Fri, Mar 5, 2010 at 5:24 AM, Markus Wichitill <mawic@gmx.de> wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference: ? ? ?5364
> > Logged by: ? ? ? ? ?Markus Wichitill
> > Email address: ? ? ?mawic@gmx.de
> > PostgreSQL version: 8.4.2
> > Operating system: ? Linux, Win7
> > Description: ? ? ? ?citext behavior when type not in public schema
> > Details:
> >
> > Comparisons with columns of type citext silently work case-sensitively
> > without any error message, unless the search_path contains "public", even if
> > the type is not located in "public", but in the same schema as the table
> > using it.
>
> Interestingly we recently got another report of this same problem.
> Tom did some analysis of it here:
>
> http://archives.postgresql.org/pgsql-bugs/2010-03/msg00017.php

I have documented this citext limitation with the attached, applied
patch.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +
Index: doc/src/sgml/citext.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/citext.sgml,v
retrieving revision 1.2
diff -c -c -r1.2 citext.sgml
*** doc/src/sgml/citext.sgml    12 Sep 2008 18:29:49 -0000    1.2
--- doc/src/sgml/citext.sgml    3 Jun 2010 03:02:48 -0000
***************
*** 205,210 ****
--- 205,219 ----
        will need two indexes if you want both types of searches to be fast.
      </para>
      </listitem>
+
+     <listitem>
+      <para>
+       The schema containing the <type>citext</> operators must be
+       in the current <varname>search_path</> (typically <literal>public</>);
+       if it is not, a normal case-sensitive <type>text</> comparison
+       is performed.
+     </para>
+     </listitem>
     </itemizedlist>
   </sect2>


pgsql-bugs by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Support on Postgres Database Corruption
Next
From: Tom Lane
Date:
Subject: Re: BUG #5364: citext behavior when type not in public schema