Search Postgresql Archives

Using Lateral

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the past I could use this in a query:

    SELECT
        DISTINCT ut,
        CASE
            WHEN xpath_exists ('//t:address_spec/t:country/text()',
                q.address_spec,
                p.ns)
            THEN unnest (xpath ('//t:address_spec/t:country/text()',
                    q.address_spec,
                    p.ns))::citext
            ELSE NULL
        END country,

No longer.  The error message suggests I should use a lateral query.
But I could not figure out in the documentation how to get the same
result using a "lateral" construct.

Just selecting "unnest(...)" gives the wrong result because if the
xpath does not exist all the other parts of the query (like 'ut' in
this case) also are empty.

Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux