public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Sam Stearns <[email protected]>
Cc: pgsql-sql <[email protected]>
Subject: Re: Postgres View DDL
Date: Wed, 16 Oct 2024 14:47:27 -0700
Message-ID: <CAKFQuwYzdVQ2pdnjD7w2HqTUR8h-Dm6L_J8YXjzYLiu9Cknt0Q@mail.gmail.com> (raw)
In-Reply-To: <CAN6TVjkTRYMBEq97tbpLsho1dGxtbJX4T_Gvy_dsZx3U82MEmA@mail.gmail.com>
References: <CAN6TVj=gp68UdbiWT1n5csgC=KsZojuM6vnt3ZgmKNkmkVeCxQ@mail.gmail.com>
	<CAN6TVjkTRYMBEq97tbpLsho1dGxtbJX4T_Gvy_dsZx3U82MEmA@mail.gmail.com>

On Wednesday, October 16, 2024, Sam Stearns <[email protected]> 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(…)::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.


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Postgres View DDL
  In-Reply-To: <CAKFQuwYzdVQ2pdnjD7w2HqTUR8h-Dm6L_J8YXjzYLiu9Cknt0Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox