Re: Postgres View DDL

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Sam Stearns <sam.stearns@dat.com>
Cc: pgsql-sql <pgsql-sql@lists.postgresql.org>
Date: 2024-10-16T21:47:27Z
Lists: pgsql-sql
On Wednesday, October 16, 2024, Sam Stearns <sam.stearns@dat.com> 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.