Re: Suggestion on column cast automatically to data type

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: postgann2020 s <postgann2020(at)gmail(dot)com>
Cc: pgpool-general(at)pgpool(dot)net, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Suggestion on column cast automatically to data type
Date: 2020-05-21 14:59:57
Message-ID: CAKFQuwZzX3GN7Y9SDsb=WP9spvWCWwxqk0hjXuqiNNAsDnfJcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Random cross-posting choices...you should restrict yourself to just posting
to -general...

On Thu, May 21, 2020 at 7:38 AM postgann2020 s <postgann2020(at)gmail(dot)com>
wrote:

> Hi Team,
> Thanks for your support.
>
> Could you please suggest on below query.
>
> We are trying to changing the data type of the column, but for every time
> triggering "column "parental_path" cannot be cast automatically to type
> tsvector".
>
> ALTER TABLE SCHEMA.TABLE ALTER COLUMN COLUMN_NAME TYPE tsvector;
>
> ERROR: column "parental_path" cannot be cast automatically to type
> tsvector
> HINT: You might need to specify "USING parental_path::tsvector".
>
> Q). Are we have any automatically changing mechanism for this type of
> conversion?.
>

Apparently not, otherwise the system would have used it...

> Even after changing, getting below error.
>
> ALTER TABLE SCHEMA.TABLE ALTER COLUMN COLUMN_NAME TYPE tsvector;
> ERROR: word is too long (2087 bytes, max 2046 bytes)
>
> Q)Suggest, how to avoid these situations?.
>
>
So what single word in your document is more than 2k in size?

You've hit a documented limit to the data type you are using.

https://www.postgresql.org/docs/12/textsearch-limitations.html

You ask for opinions but give people insufficient information about both
the data and the usage to adequately form them.

David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Raj kumar 2020-05-22 04:36:08 Lag clarification with Sync Replication
Previous Message postgann2020 s 2020-05-21 14:53:18 Re: Suggestion on index creation for TEXT data field