Re: tsvector work with citext - Mailing list pgsql-hackers

From Tom Lane
Subject Re: tsvector work with citext
Date
Msg-id 24291.1442464583@sss.pgh.pa.us
Whole thread Raw
In response to tsvector work with citext  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: tsvector work with citext
List pgsql-hackers
"David E. Wheeler" <david@kineticode.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



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Obsolete use of volatile in walsender.c, walreceiver.c, walreceiverfuncs.c?
Next
From: Michael Paquier
Date:
Subject: Re: Improving test coverage of extensions with pg_dump