pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
An inconsistency in the documentation about full text search
2+ messages / 2 participants
[nested] [flat]

* An inconsistency in the documentation about full text search
@ 2023-11-07 10:12  Erki Eessaar <erki.eessaar@taltech.ee>
  0 siblings, 1 reply; 2+ messages in thread

From: Erki Eessaar @ 2023-11-07 10:12 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

Hello

I write about the documentation of full-text search.

Section

12.2.2. Creating Indexes
https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX

wrtites the following: "Another approach is to create a separate tsvector column to hold the output of to_tsvector. To keep this column automatically up to date with its source data, use a stored generated column. This example is a concatenation of title and body, using coalesce to ensure that one field will still be indexed when the other is NULL"

Section

12.4.3. Triggers for Automatic Updates
https://www.postgresql.org/docs/current/textsearch-features.html#TEXTSEARCH-UPDATE-TRIGGERS

writes the following: "When using a separate column to store the tsvector representation of your documents, it is necessary to create a trigger to update the tsvector column when the document content columns change. Two built-in trigger functions are available for this, or you can write your own."

Thus, one part of the documentation states that one should use the generated column-based approach and another part states that one should use the trigger-based approach to keep the values in a tsvector column up-to-date. If these solutions are both appropriate, then the documentation should state this.

Perhaps something like that?

"Another approach is to create a separate tsvector column to hold the output of to_tsvector. It is possible to use a stored generated column to keep this column automatically up to date with its source data. This example is a concatenation of title and body, using coalesce to ensure that one field will still be indexed when the other is NULL"

writes the following: "When using a separate column to store the tsvector representation of your documents the column has to be kept up to date with its source data. It is possible to create a trigger to update the tsvector column when the document content columns change. Two built-in trigger functions are available for this, or you can write your own."

Best regards
Erki Eessaar

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: An inconsistency in the documentation about full text search
@ 2023-11-29 18:39  Euler Taveira <euler@eulerto.com>
  parent: Erki Eessaar <erki.eessaar@taltech.ee>
  0 siblings, 0 replies; 2+ messages in thread

From: Euler Taveira @ 2023-11-29 18:39 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org

On Tue, Nov 7, 2023, at 7:12 AM, Erki Eessaar wrote:
> Section
> 
> 12.2.2. Creating Indexes
> https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX
> 
> wrtites the following: "Another approach is to create a separate tsvector column to hold the output of to_tsvector. To keep this column automatically up to date with its source data, use a stored generated column. This example is a concatenation of title and body, using coalesce to ensure that one field will still be indexed when the other is NULL"
> 
> Section
> 
> 12.4.3. Triggers for Automatic Updates
> https://www.postgresql.org/docs/current/textsearch-features.html#TEXTSEARCH-UPDATE-TRIGGERS

This section has a note at the top that this trigger-based method is obsolete
and refers to section 12.2.2 (Creating Indexes).


--
Euler Taveira
EDB   https://www.enterprisedb.com/

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-11-29 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07 10:12 An inconsistency in the documentation about full text search Erki Eessaar <erki.eessaar@taltech.ee>
2023-11-29 18:39 ` Euler Taveira <euler@eulerto.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox