BUG #5364: citext behavior when type not in public schema

From: "Markus Wichitill" <mawic(at)gmx(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5364: citext behavior when type not in public schema
Date: 2010-03-05 10:24:24
Message-ID: 201003051024.o25AOOEZ074123@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5364
Logged by: Markus Wichitill
Email address: mawic(at)gmx(dot)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.

I don't know if this is a bug or if it's specific to citext, but it's
surprising behavior.

shell> psql template1 pgsql

template1=# CREATE DATABASE db;
CREATE DATABASE

template1=# \c db
psql (8.4.2)
You are now connected to database "db".

db=# \i /usr/local/pgsql/share/contrib/citext.sql
SET
CREATE TYPE
[...]

db=# CREATE SCHEMA sch;
CREATE SCHEMA

db=# ALTER TYPE citext SET SCHEMA sch;
ALTER TYPE

db=# SET SCHEMA 'sch';
SET

db=# CREATE TABLE tbl (col citext);
CREATE TABLE

db=# INSERT INTO tbl (col) VALUES ('val');
INSERT 0 1

db=# SELECT col FROM tbl WHERE col = 'VaL';
col
-----
(0 rows)

db=# SET search_path = sch, public;
SET

db=# SELECT col FROM tbl WHERE col = 'VaL';
col
-----
val
(1 row)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2010-03-05 11:48:53 Re: PostgreSQL-9.0alpha: jade required?
Previous Message Thomas Kellerer 2010-03-05 08:52:37 Re: BUG #5348: Postgres crashes with index on xpath_string