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 1vNyrl-004D7m-16 for pgsql-general@arkaria.postgresql.org; Tue, 25 Nov 2025 19:38:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNyrj-00B9el-35 for pgsql-general@arkaria.postgresql.org; Tue, 25 Nov 2025 19:38: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 1vNyrj-00B9ed-23 for pgsql-general@lists.postgresql.org; Tue, 25 Nov 2025 19:38:19 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vNyrh-001RjK-1o for pgsql-general@postgresql.org; Tue, 25 Nov 2025 19:38: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 447762A14D6 for ; Tue, 25 Nov 2025 11:38:17 -0800 (PST) Date: Tue, 25 Nov 2025 11:38:17 -0800 (PST) From: Rich Shepard To: pgsql-general Subject: Re: Selecting all variations of job title in a list In-Reply-To: Message-ID: <4eafa1c0-7455-2225-5f18-94cfa6f52fb@appl-ecosys.com> References: <8f256754-4ece-b67d-de5b-188b72b8a410@appl-ecosys.com> 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 Tue, 25 Nov 2025, Ron Johnson wrote: > Failed clarity on my part. The "OR clauses" are within the regex string. Ron, That's okay. > 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="mumble". That's impractical. The title table would be hundreds of rows long, most having only 1 or 2 references. Companies don't have standard titles for everyone. Rich