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 1vNyjd-00474b-1R for pgsql-general@arkaria.postgresql.org; Tue, 25 Nov 2025 19:29:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNyjb-00B2hz-2H for pgsql-general@arkaria.postgresql.org; Tue, 25 Nov 2025 19:29:56 +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 1vNyjb-00B2hr-11 for pgsql-general@lists.postgresql.org; Tue, 25 Nov 2025 19:29:55 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vNyjY-001RfV-2X for pgsql-general@postgresql.org; Tue, 25 Nov 2025 19:29:54 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-657509d761dso2967958eaf.0 for ; Tue, 25 Nov 2025 11:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764098993; x=1764703793; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=d6lLhEVcme/zJ1ZiQSiN83P2F6M6y/mE9v4PT8ELLgQ=; b=dSnGq+8FqbHHHTPpNJtcCbLbYaO3mo0CFKD60TzEI1vUfEG+rvEXc7Ah/zTDrRRzob HRIMhCFzxHI9C4K+TN6AxTt791NwUdZEFk879/6HgLoBqGVNni843ORFRr8n7LHPmTfL NMfO9fv+kwlXwULkcbpZ0uwayDFsC2/ytUhX3iBRFkgXBI1hGPm/gbzx9OWSl9oOEPSS rARh5sz7NauE3xJ8ll1/rhWNUnnvbbOwpW8qm5q5a1Pvrjmk7esT7vjrof5JvP0lnWAb Zq0/aRg91l2MXpg7wzCfbSkDwHiOUibZvRqGFBcKSGtSnZI08isdw+R92SUJZhoo2F38 mK+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764098993; x=1764703793; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d6lLhEVcme/zJ1ZiQSiN83P2F6M6y/mE9v4PT8ELLgQ=; b=NzGSynkzZbp/IV16FKBL/f6QbB5hOHRlpAJtnvwdNzByTg08d3mEXqSAtsyhtp/Tmw 6CE04APaSTjeMVXlge9xlsjbIDOih7/D7/KM5HaX86tzHoaIiN/BvV4BxRIUoiCW1b9v iBPfarKXBrC4eTl2kJkQ2045Ln38GVKbqobpEdmDi5DFK0ZWeDeZz1lbR2iYyMR9aEjN 7gE8i3Uw/r/vQbdkv2GPRVWxZx5oTFdfhI04YIM3DsUyd6j19g9AD1ebhe3Ex39qVACk nqX0/PKJRJ0SYpk0T4zurO6JbodXGpCBia1BEhFqNzrC0ffW58+IIZoLSNKlHwRJTRl5 LUCA== X-Gm-Message-State: AOJu0YyNBvm3N9WezzX9/ga0f/1UgY1GoRqN78VZMtfP2PvdeuXhofHr gNC8+FIAub9pe3teQCps0451Z6MMHkMR9fd0iV56VTD4S6Ft7uiB31dlIleHl9+9ZHBJVvEjlx5 2FwRSFb5CSWvGdyVqiLcyr9n+iQXkJ7P0D992 X-Gm-Gg: ASbGncu0mIvFWuUHucRhhdQv/ofYf91ZvMszZIQ+ybdyDXu6bOp5GwAJvoAgJWvBeFi uRkoffkosmscc0+zJCvWoKNkfkOPsUptRydR3hKGLWplwE10eMMs35E1+svEQ9veKIfnkXb2W37 aVF0gKGi1ip/L7/9onerVmoBqNMbar/6duKOPb4BcfHdIj69gPvLQQrIsQKxQI7NPMLE5v9vL/X N0aSqzEsP1ak4RD+nxboT4l/KTF70FcjNRyeP7PJORf7pK+YBcZXNASTOzRD8gKgVI6uCZgFcxZ 6ubHVX8= X-Google-Smtp-Source: AGHT+IEnwUilXiUSxxkkD2FWgpKTm2wrPpPDLnjFLK8xbJSHQgjgsCD5CyGFwmKtD4JoDFqZdNcY+7YRP+EFK5mtQus= X-Received: by 2002:a05:6820:4d41:20b0:657:6103:4929 with SMTP id 006d021491bc7-6579255a14cmr4801505eaf.7.1764098992511; Tue, 25 Nov 2025 11:29:52 -0800 (PST) MIME-Version: 1.0 References: <8f256754-4ece-b67d-de5b-188b72b8a410@appl-ecosys.com> In-Reply-To: <8f256754-4ece-b67d-de5b-188b72b8a410@appl-ecosys.com> From: Ron Johnson Date: Tue, 25 Nov 2025 14:29:41 -0500 X-Gm-Features: AWmQ_blSaXZ61MEsixD3Waya0JBbwCpWWflmIyXpGfXPipfpsYrs6Tmq7V3Ddgc Message-ID: Subject: Re: Selecting all variations of job title in a list To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000cc27060644704d1b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000cc27060644704d1b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Nov 25, 2025 at 2:05=E2=80=AFPM Rich Shepard wrote: > On Tue, 25 Nov 2025, Ron Johnson wrote: > > > Maybe regex_match() with a bunch of OR clauses. > > > > In bash, I'd do something like: > > grep -E ' ^Asst Gen Mgr.*|^Env Mgr.*|^Gen Mgr.*|^Mgr.*|^Plant Mgr..*' > > foo.txt > > Ron, > > I've not used regex in postgres before, only in emacs and small languages= . > So I'll learn how to do this. I was trying to avoid multiple OR clauses, > but > that script will not be run often so it should not matter. > Failed clarity on my part. The "OR clauses" are within the regex string. Note that The Relational Way of doing this is for everyone to have title_code in their "person" record, and the "title" table will have, in addition to the title_code PK column, the title_description, title_abbreviation ( 'Asst Gen Mgr.', 'Env Mgr,', 'Gen Mgr,'. 'Mgr,', 'Plant Mgr.') and title_group columns. All those manager titles would be in the same group. You'd then join "person" to "title" and filter where title_group=3D"mumble". --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000cc27060644704d1b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Nov 25, 2025 at 2:05=E2=80=AFPM R= ich Shepard <rshepard@appl-e= cosys.com> wrote:
On Tue, 25 Nov 2025, = Ron Johnson wrote:

> Maybe regex_match() with a bunch of OR clauses.
>
> In bash, I'd do something like:
> grep -E ' ^Asst Gen Mgr.*|^Env Mgr.*|^Gen Mgr.*|^Mgr.*|^Plant Mgr.= .*'
> foo.txt

Ron,

I've not used regex in postgres before, only in emacs and small languag= es.
So I'll learn how to do this. I was trying to avoid multiple OR clauses= , but
that script will not be run often so it should not matter.
=

Failed clarity on my part.=C2=A0 The &= quot;OR clauses" are within the regex string.

Note that The Relational Way of doing this is for everyone to have title_c= ode in their "person" record, and the "title" table wil= l have, in addition to the title_code PK column, the title_description, tit= le_abbreviation ( 'Asst Gen Mgr.', 'Env Mgr,', 'Gen Mgr= ,'. 'Mgr,', 'Plant Mgr.') and title_group columns.=C2= =A0 All those manager=C2=A0titles would be in the same group.=C2=A0 You'= ;d then join "person" to "title" and filter where title= _group=3D"mumble".

--
Death to <Redacted>, and butter sauce.
Don't boil= me, I'm still alive.
<Redacted> lobster!
--000000000000cc27060644704d1b--