Re: Pgsql error in coalesce
От | Chamath Sajeewa |
---|---|
Тема | Re: Pgsql error in coalesce |
Дата | |
Msg-id | CACpofehvF5i2SdGOktfR7-HiJOtmfpq2aX+_yJ=efC7xZ3L0YQ@mail.gmail.com обсуждение исходный текст |
Ответ на | RE: Pgsql error in coalesce (Stephen Froehlich <s.froehlich@cablelabs.com>) |
Ответы |
RE: Pgsql error in coalesce
|
Список | pgsql-novice |
Hi,
Query is working properly when column_name::integer is used. I wonder Why is it required when column type is already set to int4. Any idea?
On Mon, 27 Jul 2020, 22:35 Stephen Froehlich, <s.froehlich@cablelabs.com> wrote:
What do you get with the following two type castings:
SELECT coalesce(column_name::integer, 255); ?
SELECT coalesce(column_name, ‘255’::text)::integer; ?
“integer” might actually be “smallint” if you’re only going to 255.
--Stephen
From: Chamath Sajeewa <csgsajeewa@gmail.com>
Sent: Monday, July 27, 2020 10:51
To: pgsql-novice@lists.postgresql.org
Subject: Pgsql error in coalesce
Hi,
There is table with int4 column. When select query is executed as "select coalesce(column_name, 255), query is failing with below error.
"COALESCE types text and integer cannot be mached".
Any idea?
Thank You!!
В списке pgsql-novice по дате отправления: