Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk1Co-0005wj-CS for pgsql-docs@arkaria.postgresql.org; Wed, 05 Apr 2023 11:21:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pk1Cn-0001ej-A6 for pgsql-docs@arkaria.postgresql.org; Wed, 05 Apr 2023 11:21:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pk19i-0005E6-Di for pgsql-docs@lists.postgresql.org; Wed, 05 Apr 2023 11:18:22 +0000 Received: from mxd-1-4e6.seznam.cz ([2a02:598:128:8a00::1000:4e6]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pk19f-0011Xm-An for pgsql-docs@lists.postgresql.org; Wed, 05 Apr 2023 11:18:21 +0000 Received: from email.seznam.cz by smtpc-mxd-797dd8fc6d-nsw9h (smtpc-mxd-797dd8fc6d-nsw9h [2a02:598:128:8a00::1000:4e6]) id 2407454b1bf8e30a24052d3f; Wed, 05 Apr 2023 13:18:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seznam.cz; s=szn20221014; t=1680693496; bh=1eM3V3a6iK9ga8v0i3BZAGu/0V/bJTHphuNEp2uvK+w=; h=Received:Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S7fhQEcaZb4hDFPwKgXwx9sb4MJnKz4JUSKC3hHimltS1NUXzXW6SAcUnzXdJh42C KCTKMUJornmxypyqQe1O4EiY5bSB/UrBrJJoY+4fnoTRoFfWttuVwFRGXoj68UB5KI /gZ3KoxjCTColDyhRd8U/ok6rN8azDTyiKZokdZvKn2iry2noMAeI6FxTAhKefwWHL mRrTzDx9ENoF93wEvvq72khcphwt/5kKYNz8VN0PfR2hNd99yKqGny9t0q5IP8Mifm 2hDtsfw8qE2D399NKx7M8pfhELIXNeRZMuyAUviwcco1PHjSQad8sybGcZ9Dw6LKsh KBxxIBacBOvdQ== Received: from localhost (ip-217-030-071-185.aim-net.cz [217.30.71.185]) by smtpd-relay-54787d77c7-gll54 (smtpd/2.0.9) with ESMTPA id ba76379c-11d6-4cc7-8090-183d019104ea; Wed, 05 Apr 2023 13:18:14 +0200 Date: Wed, 5 Apr 2023 13:18:12 +0200 From: Jiri Verunek To: pgsql-docs@lists.postgresql.org Subject: Re: Bug in the documentation - to_tsquery( 'postgres:*' ); Message-ID: <20230405111812.GA12970@ntb> References: <168068324809.625.9758151466474571203@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <168068324809.625.9758151466474571203@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Maybe the documentation could say that it is assumed that the database is configured with default_text_search_config = 'english' in the configuration file. In case of my distribution, the parameter was set to 'pg_catalog.simple'. /etc/postgresql//main/postgresql.conf default_text_search_config = 'pg_catalog.simple' Jiri On Wed, Apr 05, 2023 at 08:27:28AM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/15/index.html > Description: > > There is a bug in the documentation on the link > https://www.postgresql.org/docs/current/datatype-textsearch.html > > postgres does not get stemmed to postgr by :to_tsquery( 'postgres:*' ); > and > SELECT to_tsvector( 'postgraduate' ) @@ to_tsquery( 'postgres:*' ); > returns f. > > I am using PostgreSQL 12.14 but the documentation for PostgreSQL 12 is not > correct either. > Here is the output from my system: > SELECT to_tsvector( 'postgraduate' ), to_tsquery( 'postgres:*' ); > to_tsvector | to_tsquery > ------------------+-------------- > 'postgraduate':1 | 'postgres':* > (1 row) > > So the below mentioned citation seems to be wrong. > > > Citation: > > Note that to_tsquery will process prefixes in the same way as other words, > which means this comparison returns true: > > SELECT to_tsvector( 'postgraduate' ) @@ to_tsquery( 'postgres:*' ); > ?column? > ---------- > t > > because postgres gets stemmed to postgr: > > SELECT to_tsvector( 'postgraduate' ), to_tsquery( 'postgres:*' ); > to_tsvector | to_tsquery > ---------------+------------ > 'postgradu':1 | 'postgr':* > > which will match the stemmed form of postgraduate.