citext plugin is not working with java applications

Started by PG Bug reporting formover 7 years ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/citext.html
Description:

The citext plugin does not work in combination with jdbc. Thus it does not
work with Java applications. It does work in pgadmin because that is python.
I am using the right schema, and setting the jdbc stringtype to unspecified
makes no difference.
Because Java is the most used programming language, a big warning on the
postgresql citext documentation
(https://www.postgresql.org/docs/10/citext.html) is needed until this is
fixed.
Case insensitive text is standard on many databases, thus this may be a big
obstacle when you want to migrate.

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: citext plugin is not working with java applications

On Mon, Dec 10, 2018 at 10:21:26AM +0000, PG Doc comments form wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/citext.html
Description:

The citext plugin does not work in combination with jdbc. Thus it does not
work with Java applications. It does work in pgadmin because that is python.
I am using the right schema, and setting the jdbc stringtype to unspecified
makes no difference.
Because Java is the most used programming language, a big warning on the
postgresql citext documentation
(https://www.postgresql.org/docs/10/citext.html) is needed until this is
fixed.
Case insensitive text is standard on many databases, thus this may be a big
obstacle when you want to migrate.

You have not explained what "does not work" means.

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

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +
#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Bruce Momjian (#2)
Re: citext plugin is not working with java applications

On Mon, Jan 21, 2019 at 7:39 PM Bruce Momjian <bruce@momjian.us> wrote:

You have not explained what "does not work" means.

True...but assuming it is true would we accept placing a
driver-specific warning here? We do not do so anywhere else in the
documentation that I am aware.

The main issue, IIUC, is that Prepared Statements require their input
types to be known while most users write queries without specifying
data types explicitly. The JDBC driver falls back to determining the
untyped input as text instead of citext which forces a "text op text"
comparison instead of a "citext op citext" one when the query is
executed.

The JDBC docs don't seem to cover this, which they should as it is
their limitation, not ours (that I am aware of...), though I'm unsure
exactly what the limitation stems from.

David J.