Generated user-defined column not defined correctly
MichaelDBA opened this issue · 1 comments
MichaelDBA commented
Valid Table definition:
CREATE TABLE myschema.mytable (
id uuid NOT NULL,
email public.citext NOT NULL,
searchable tsvector GENERATED ALWAYS AS (to_tsvector('simple'::regconfig, COALESCE(public.translate(email, '@.-'::public.citext, ' '::text), ''::text))) STORED,
searchable2 tsvector DEFAULT to_tsvector('simple'::regconfig, ''::text)
);
Invalid output:
CREATE TABLE myschema.mytable (
id uuid NOT NULL,
email public.citext NOT NULL,
searchable tsvector NULL
) TABLESPACE pg_default;
Output misses an entire column ("searchable2") and wrongly defines the other vector column ("searchable").
MichaelDBA commented
Fixed with the latest version for autogenerated columns.