Re: tsvector work with citext

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Me Chai Swee <mech(at)me(dot)com>
Subject: Re: tsvector work with citext
Date: 2015-09-17 04:36:23
Message-ID: 24291.1442464583@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> Is there a way to get tsvector_update_trigger() to work with citext
> columns?

Hmm ... tsvector_op.c has

/* Check if datatype is TEXT or binary-equivalent to it */
static bool
is_text_type(Oid typid)
{
/* varchar(n) and char(n) are binary-compatible with text */
if (typid == TEXTOID || typid == VARCHAROID || typid == BPCHAROID)
return true;
/* Allow domains over these types, too */
typid = getBaseType(typid);
if (typid == TEXTOID || typid == VARCHAROID || typid == BPCHAROID)
return true;
return false;
}

and a look at the caller says that "binary-equivalent to TEXT" is indeed
the requirement, because we want to apply DatumGetTextP() to the argument.

However, it does seem like this function is not implementing its
specification. Why isn't it just "IsBinaryCoercible(typid, TEXTOID)"?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-09-17 05:18:55 Re: Improving test coverage of extensions with pg_dump
Previous Message Thomas Munro 2015-09-17 04:32:17 Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?