public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chamath Sajeewa <[email protected]>
To: Vianello, Dan A <[email protected]>
Cc: [email protected]
Subject: Re: [EXTERNAL] Pgsql error in coalesce
Date: Mon, 27 Jul 2020 23:02:42 +0530
Message-ID: <CACpofehkYKLsr5DwvAqLjKMaLYAU9T1hJTh6D3OPS68oKynbtQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CACpofejQ12OBATx9Mi1YB24bj4Y4Ey6gq0fmncPp-b3hAyRtyQ@mail.gmail.com>
	<[email protected]>

Hi,
I thought it check the data type of the specified column. Isn't it the case
here?

On Mon, 27 Jul 2020, 22:57 Vianello, Dan A, <[email protected]>
wrote:

> Your column name “column_name” is of type text. The number 255 is an
> integer.  Since those datatypes don’t match the coalesce function fails.
> If the data in “column_name” can always be cast to an integer then you can
> use
>
>
>
> Select coalesce(column_name::integer, 255);
>
>
>
> Or you can cast 255 to a text string of ‘255’ with this:
>
> Select coalesce(column_name, '255'::text);
>
>
>
>
> The contents of this e-mail message and
> any attachments are intended solely for the
> addressee(s) and may contain confidential
> and/or legally privileged information. If you
> are not the intended recipient of this message
> or if this message has been addressed to you
> in error, please immediately alert the sender
> by reply e-mail and then delete this message
> and any attachments. If you are not the
> intended recipient, you are notified that
> any use, dissemination, distribution, copying,
> or storage of this message or any attachment
> is strictly prohibited.
>


view thread (10+ messages)  latest in thread

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: [EXTERNAL] Pgsql error in coalesce
  In-Reply-To: <CACpofehkYKLsr5DwvAqLjKMaLYAU9T1hJTh6D3OPS68oKynbtQ@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