[BUGS] tsvector_update_trigger() fails in 9.6 on character(2) column - Mailing list pgsql-bugs

From Matt Magoffin
Subject [BUGS] tsvector_update_trigger() fails in 9.6 on character(2) column
Date
Msg-id 016F132F-67E0-4576-A388-A5FABAC89235@msqr.us
Whole thread Raw
Responses Re: [BUGS] tsvector_update_trigger() fails in 9.6 on character(2) column  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I am migrating a 9.3 database to 9.6, and came across what looks like a possible regression somewhere in
tsvector_update_trigger()when passed a column of type character. The following works in 9.3: 

CREATE TABLE public.foo (
  foo_id integer NOT NULL,
  country character(2) NOT NULL,
   fts tsvector,
  CONSTRAINT foo_pk PRIMARY KEY (foo_id)
);
CREATE TRIGGER maintain_fts
  BEFORE INSERT OR UPDATE
  ON public.foo
  FOR EACH ROW
  EXECUTE PROCEDURE tsvector_update_trigger('fts', 'pg_catalog.english', 'country');

INSERT INTO public.foo (foo_id, country) VALUES (1, 'US');

But the same thing in 9.6 results in :

ERROR: column "country" is not of a character type

I traced this back to tsvector_update_trigger() because if I disable that trigger the INSERT statement will succeed.

If I change the column to character varying(2), then the INSERT succeeds as well.

Kind regards,
Matt

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14584: Segmentation fault importing large XML file
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] tsvector_update_trigger() fails in 9.6 on character(2) column