Re: Postgres View DDL - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Postgres View DDL
Date
Msg-id CAKFQuwYzdVQ2pdnjD7w2HqTUR8h-Dm6L_J8YXjzYLiu9Cknt0Q@mail.gmail.com
Whole thread Raw
In response to Re: Postgres View DDL  (Sam Stearns <sam.stearns@dat.com>)
List 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.
 

pgsql-sql by date:

Previous
From: Sam Stearns
Date:
Subject: Re: Postgres View DDL
Next
From: William Alves Da Silva
Date:
Subject: Re: Postgres View DDL