Re: Postgres View DDL

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Sam Stearns <sam(dot)stearns(at)dat(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres View DDL
Date: 2024-10-16 21:47:27
Message-ID: CAKFQuwYzdVQ2pdnjD7w2HqTUR8h-Dm6L_J8YXjzYLiu9Cknt0Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wednesday, October 16, 2024, Sam Stearns <sam(dot)stearns(at)dat(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message William Alves Da Silva 2024-10-16 22:04:17 Re: Postgres View DDL
Previous Message Sam Stearns 2024-10-16 21:42:28 Re: Postgres View DDL