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 1p6di7-0001fS-1e for pgsql-general@arkaria.postgresql.org; Sat, 17 Dec 2022 20:23:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p6di5-00089L-Q2 for pgsql-general@arkaria.postgresql.org; Sat, 17 Dec 2022 20:23:05 +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 1p6di5-00089C-FL for pgsql-general@lists.postgresql.org; Sat, 17 Dec 2022 20:23:05 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6di0-00011G-WF for pgsql-general@lists.postgresql.org; Sat, 17 Dec 2022 20:23:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F10195C004D; Sat, 17 Dec 2022 15:22:57 -0500 (EST) Received: from imap42 ([10.202.2.92]) by compute5.internal (MEProxy); Sat, 17 Dec 2022 15:22:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=langille.org; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1671308577; x=1671394977; bh=A2OUNeS3xW tW+NErG9DlK53bTZ2FI8wZHwIp4GoYfAk=; b=KXnJLStVFB0ovv/Oe/u3sJD4oP t3ad/0tSDwap2p7KjuECfMCPtsb9IlOYwQhStqzu15DA+o3pWwMXVltTYQLkqSV9 DnZZeLB6r05Zjzjp3HIKitv5I/ohC9FV3RHVSRjXW/Zati6E5Yn7/v+XAYWkc2ZY A/HHaGkvDBGENAS/7keZlyubJ+LaRc7smK6DFxSomQ8zTw9HCaINmtglfN042F6T b94Wlw5uG0QPs5Zp1hiRYxompJfWl8RGrKTUD5UM2W9E1KBgHfz4efz/c7KOizlY 6K/xrF0Ly+bFsamXBmiG0aGNFR0RpD8vTm5RAL/XkMEYqdfmc+CVDBxa8lZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1671308577; x=1671394977; bh=A2OUNeS3xWtW+NErG9DlK53bTZ2F I8wZHwIp4GoYfAk=; b=RKMzav6u8zihPwGY4hj39NcrnaUeifI1uQcbswV79q5d yqBkITDLeLVHvTkesP3pT1QH3RbL4pzUa2QaVCFFB5uu5zORVd5CeWeYdc+NrUg0 X1P/+XzwNSQsVY/HxAxG/6cVRxDINm2ARvODVJoA5sdDpbgsg9q4y7MAa1+I8LTr 6wD07HkFbnnJRwLVh4y3CmeOQEScSnKcCW0DKQ9aaNTbGPZJrT/HCLw+8C9DkEPn /POtnNQCfZMupjpz4x511AG8GW0HQ8ssnWrXfMIIF63rP6+ZcmHIgMy4Jkw9NBiY xWra0ukMZmnHz1ChHP9mgKa0f5SQvF58hrk29J7gfg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelgddufeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgesth dtredtreertdenucfhrhhomhepfdffrghnucfnrghnghhilhhlvgdfuceouggrnheslhgr nhhgihhllhgvrdhorhhgqeenucggtffrrghtthgvrhhnpeehiefhudetffeuvddvveelle ekvdejhfdukeelhfehgfffheffgfffkeelleejffenucffohhmrghinhepfhhrvghshhhp ohhrthhsrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepuggrnheslhgrnhhgihhllhgvrdhorhhg X-ME-Proxy: Feedback-ID: ifbf9424e:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C969EBC0078; Sat, 17 Dec 2022 15:22:57 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: <6ad40e1f-09dc-4002-8f54-0e2657137aef@app.fastmail.com> In-Reply-To: References: <2797dd29-aebb-43a2-9fd7-63bd77a944b2@app.fastmail.com> <9f89f00a-e400-4a9b-803b-f84999b6ffca@app.fastmail.com> <4006202.1671306931@sss.pgh.pa.us> Date: Sat, 17 Dec 2022 15:22:37 -0500 From: "Dan Langille" To: "Tom Lane" Cc: pgsql-general@lists.postgresql.org Subject: Re: tsvector not giving expected results on one host Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Dec 17, 2022, at 3:14 PM, Dan Langille wrote: > On Sat, Dec 17, 2022, at 2:55 PM, Tom Lane wrote: >> "Dan Langille" writes: >>> pkgmessage_textsearchable2 | tsvector | | | generated always as (to_tsvector('english'::regconfig, translate(pkgmessage, '/'::text, ' '::text))) stored >> >> That is not likely to play well with this: >> >>> freshports.org=> show default_text_search_config ; >>> default_text_search_config >>> ---------------------------- >>> pg_catalog.simple >> >> because "english" and "simple" will stem words differently. >> >> regression=# select websearch_to_tsquery('english', 'example'); >> websearch_to_tsquery >> ---------------------- >> 'exampl' >> (1 row) >> >> regression=# select websearch_to_tsquery('simple', 'example'); >> websearch_to_tsquery >> ---------------------- >> 'example' >> (1 row) >> >> If what is in your tsvector is 'exampl', then only the first of >> these will match. So IMO the question is not "why is it failing >> on prod?", it's "how the heck did it work on the other machine?". >> You won't get nice results if websearch_to_tsquery is using a >> different TS configuration than to_tsvector did. > > I think this shows why we are getting the results we see. Credit to ch > on IRC for asking this question. > > The problem host: > > freshports.org=> select websearch_to_tsquery('example'); > websearch_to_tsquery > ---------------------- > 'example' > (1 row) Ahh, this explains the differences and as to why it works where it shouldn't? freshports.org=> select setting, source from pg_settings where name = 'default_text_search_config'; setting | source -------------------+--------- pg_catalog.simple | default (1 row) > > The hosts on which this search works > > freshports.devgit=# select websearch_to_tsquery('example'); > websearch_to_tsquery > ---------------------- > 'exampl' > (1 row) freshports.devgit=# select setting, source from pg_settings where name = 'default_text_search_config'; setting | source --------------------+-------------------- pg_catalog.english | configuration file (1 row) At least now I know what I can play with to get all hosts in sync. -- Dan Langille dan@langille.org