[postgis-users] select a, b, c, case statement is not robust - no error message

Simon Greener simon at spatialdbadvisor.com
Tue Jan 5 16:41:42 PST 2021


Wrap each side with coalesce.

⁣Get BlueMail for Android ​

On 6 Jan 2021, 11:16, at 11:16, Shaozhong SHI <shishaozhong at gmail.com> wrote:
>Hi, Simon,
>Good point.  I suspect when there is null, it is a problem.
>Regards,
>David
>
>On Tuesday, 5 January 2021, Simon Greener <simon at spatialdbadvisor.com>
>wrote:
>
>> Do any of the left or right sides of a || pair return NULL?
>> Simon
>>
>> Get BlueMail for Android <http://www.bluemail.me/r?b=16117>
>> On 6 Jan 2021, at 10:10, Shaozhong SHI <shishaozhong at gmail.com>
>wrote:
>>>
>>> Hi,
>>>
>>> One of my scripts worked very well, but for unknown reasons, it does
>not
>>> work.
>>>
>>> It is something like the following:
>>>
>>> select a, b, c, case statement as d from a_table;
>>>
>>> The case statement has a lot of cases, which are joined by using ||.
>>>
>>> Data is certainly there, but the result of case statement as d is
>empty.
>>>
>>> Any other robust way to deal with this?
>>>
>>> Can anyone enlighten me?
>>>
>>> Regards,
>>>
>>> David
>>>
>>> ------------------------------
>>>
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at lists.osgeo.org
>https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20210106/188376f3/attachment.html>


More information about the postgis-users mailing list