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.94.2) (envelope-from ) id 1t1Brg-00F6fC-Q1 for pgsql-sql@arkaria.postgresql.org; Wed, 16 Oct 2024 21:47:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t1Brf-00AtVx-1V for pgsql-sql@arkaria.postgresql.org; Wed, 16 Oct 2024 21:47:31 +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.94.2) (envelope-from ) id 1t1Bre-00AtVo-OV for pgsql-sql@lists.postgresql.org; Wed, 16 Oct 2024 21:47:31 +0000 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t1Brc-001FeE-HU for pgsql-sql@lists.postgresql.org; Wed, 16 Oct 2024 21:47:29 +0000 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5e98bfea0ceso201031eaf.0 for ; Wed, 16 Oct 2024 14:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729115248; x=1729720048; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Grpm6n4kb7bZPPp1d7iXc5CEsMY3zjM4CQUBfzTVs8s=; b=ATg5CPFGWNxcDY3HixYOp74+zQmkjsDs9Icokvnqm/GvfCk/NIo9saoMUqedfWd5W1 o4hhV647RJW6eHYhAm1n4l8NdaUMT6CMmlyfXXLbETwMe/udPtouB9pgS1WMPug7byyf QtiGlZyFqlFIw0dKrXDHDeU/fHYlyT9wq3frDfMtVpoMO4JIrblC24BjCU73JErVHNq7 pMH45+gG//DHBc7MYWWjJ8uk9OoK4BS6dHRGUi+rL18nH7pc7Xwo39t2amhOLNG7PUY1 po3kumS8BF00NWJcqQ8cX1yhIuJB1jfH5ixlLoRDs+7BYFpqxIfhqRjcXruc910/7RwU IhSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729115248; x=1729720048; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Grpm6n4kb7bZPPp1d7iXc5CEsMY3zjM4CQUBfzTVs8s=; b=IL3Q5u1vIIcJOJELdQEkvodnQgjMfIC05hmQqCttxHlGpjiZyqlpFEKZGd2hEgM+De 7cyNCSDKyvZgiiYa1vRVoHzTQPkDRbDbi/bz7aZcFaAwTfzG7a6bOnCx1DIZgQ+n0rm8 O476fUwyTC88Ys2OVzZhDudtaHaYAQbj3UXq9V9uD8VDKCzShrSZfd3roAdXxNovjSKe SJ40lrV8HyTrMt4ZOTsDWjpbOPLCcyr0oLPq57FH4rREIpjWzyAADP/Ld0By8blel2x4 A4n2zP+s2fwKtQ4tME8e1gwtXQP5qmkoZZByAJ81JRrcu5HldhjJALMd0u0TkUWcSbS5 RjmA== X-Gm-Message-State: AOJu0YwQ8ySTBiX/SoUqeQ80IRNlGSph8pTLEJogH9cwHG5x8d1rGkFu aStjpqofV4GFnk5rltgapBb4zzN+esVQsdpUvJEIw1r0wCWIlhwPpEIG/1iZw4CazyKwmai1vFv 7AccHyraR9O9IZBuySV//xrpfN1XPhw== X-Google-Smtp-Source: AGHT+IGHRYT7mF/lWx/8AokwxqZ/EXorqgYJHB4RNeZwBhXmL5rfk43Nf9IANbx5iBJ/K1+qWfFoTyFqWUAYJz2Ldpc= X-Received: by 2002:a05:687c:92:b0:288:ab90:ed87 with SMTP id 586e51a60fabf-288ab90f06emr6315206fac.17.1729115247627; Wed, 16 Oct 2024 14:47:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:5856:0:b0:56c:c9af:3ee6 with HTTP; Wed, 16 Oct 2024 14:47:27 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Wed, 16 Oct 2024 14:47:27 -0700 Message-ID: Subject: Re: Postgres View DDL To: Sam Stearns Cc: pgsql-sql Content-Type: multipart/alternative; boundary="0000000000001c577106249f04a2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001c577106249f04a2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, October 16, 2024, Sam Stearns wrote: > Tried changing to this: > (coalesce(REGEXP_REPLACE(broker_mc::numeric, '[^0-9]+', '', 'g'), 0))= , > Both parts of the coalesce need to be integer. Therefore: regexp_replace(=E2=80=A6)::integer In short, the output of the text manipulation better be something that can be cast to integer if you want coalesce to produce an integer. David J. --0000000000001c577106249f04a2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, October 16, 2024, Sam Stearns <sam.stearns@dat.com> wrote:
Tried changing to this:
=C2=A0 =C2=A0 (coalesce(= REGEXP_REPLACE(broker_mc::numeric, '[^0-9]+', '', '= ;g'), 0)),

Both parts o= f the coalesce need to be integer.=C2=A0 Therefore:

regexp_replace(=E2=80=A6)::integer

In short, the= output of the text manipulation better be something that can be cast to in= teger if you want coalesce to produce an integer.

= David J.
=C2=A0
--0000000000001c577106249f04a2--