Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vOH9y-000TOf-03 for pgsql-general@arkaria.postgresql.org; Wed, 26 Nov 2025 15:10:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOH9w-00HMbH-1b for pgsql-general@arkaria.postgresql.org; Wed, 26 Nov 2025 15:10:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vOH9w-00HMb7-0W for pgsql-general@lists.postgresql.org; Wed, 26 Nov 2025 15:10:20 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vOH9t-001aas-1w for pgsql-general@lists.postgresql.org; Wed, 26 Nov 2025 15:10:19 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 06DA32A14D6 for ; Wed, 26 Nov 2025 07:10:17 -0800 (PST) Date: Wed, 26 Nov 2025 07:10:16 -0800 (PST) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Selecting all variations of job title in a list In-Reply-To: <20251126154844.e6e3d5c7f476cc966fc201f4@wanadoo.fr> Message-ID: <29ffee7e-40a8-f911-4419-24ba8558f5db@appl-ecosys.com> References: <20251126154844.e6e3d5c7f476cc966fc201f4@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 26 Nov 2025, Vincent Veyron wrote: > As Ron wrote, a regexp would do it, I guess? > > SELECT * FROM people WHERE title ~ 'Asst Gen Mgr|Env Mgr|Gen Mgr|Mgr|Plant Mgr'; > > Although in your example, you would get the same result with just: > > SELECT * FROM people WHERE title ~ 'Mgr'; > > https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP Vincent, Learning postgres regexp is at the top of my list. Thanks, Rich