public inbox for [email protected]
help / color / mirror / Atom feedFrom: Vianello, Dan A <[email protected]>
To: Chamath Sajeewa <[email protected]>
To: [email protected] <[email protected]>
Subject: RE: [EXTERNAL] Pgsql error in coalesce
Date: Mon, 27 Jul 2020 17:27:00 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACpofejQ12OBATx9Mi1YB24bj4Y4Ey6gq0fmncPp-b3hAyRtyQ@mail.gmail.com>
References: <CACpofejQ12OBATx9Mi1YB24bj4Y4Ey6gq0fmncPp-b3hAyRtyQ@mail.gmail.com>
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);
E-MAIL CONFIDENTIALITY NOTICE:
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: <[email protected]>
* 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