Re: Error while executing a view in postgres 10.5

"Jonathan S. Katz" <[email protected]> Fri, 22 Mar 2019 09:08:38 -0400
Newsgroups gmane.comp.db.postgresql.sql
Message-ID <[email protected]>
Hi,

> ERROR:  set-returning functions are not allowed in CASE
> LINE 37:                         else regexp_split_to_table(privs,E'\...
>                                      ^
> HINT:  You might be able to move the set-returning function into a LATERAL
> FROM item.

Starting in PostgreSQL 10, set-returning functions are no longer
allowed in CASE statements[1].

As it suggests, you can try moving the expression to a LATERAL
subquery[2]. Taking a quick look at the query, you would need
to rewrite a good portion of it in order to do so, but it would then
work with the updated versions of PostgreSQL.

Jonathan

[1] https://www.postgresql.org/docs/release/10.0/ <https://www.postgresql.org/docs/release/10.0/> - search for
“Change the implementation of set-returning functions”
[2] https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-LATERAL <https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-LATERAL>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE+oS2la8r95ogZD/x8QSccp8cZScFAlyU3lYACgkQ8QSccp8c
ZScVTw/6AgW+yYejj6BqMJ6bRUjlQlGXcQ6z/V79hZGKkWEaIRI06zpdoLCeOgts
Sxkcz3SupKZVcXJ1b8P9LJTidCRPdUh91Jtq/SOwmBdybdNCHGzghvbK8nERAcmL
bFzvjOg1k5HsHsCxXICr07nlIOXn918jGZFt3yVmrn8N4gno0gfGWOT94xlAHp7P
Q/HYDXjgd1rg/ubSVbrLCAQ9QB4wgSznC4vNM+iLJb5KqNeVxUV51YzPguJaWqoO
J3tnV4GIiMho0VpU3c2jsgj542xKVsIRMlwZUrL03QEhIaf/Lu+qrApu/NsLOGu1
4FlnTNv/fwAnjMNmXLvhfhhoTQW8zccTp7a48fuyeKReIdN+Q8esWLpB+LwetoXW
APzEUT+waCnvBsbtqNo4x1kb4q3cl2+cUbhGHisAnPRq0EAjgLPua1Y3wNTJiCxh
rDkICUJt5UfX9d66fltbjICYWpu7ZVFTeo0YPWH9iqbR+FdmIRlRF3F+ZWD7sfY3
Y9XDtB5923LQVNCbnJLgxBiYjOKZY72JknIgAjN1HFVg2TXp26jDaQU3gcFw5n/q
nCv726D2bNSizzFKEEBeuEfpj8HQL3TuKeFkhQrNt95+DV9lbi0yif5CIhv1+zvx
6YnxDLnNM8+65kf3jImMkjAuvt8HHeirUpTYUGSfqTT9X6NkQpM=
=b+TZ
-----END PGP SIGNATURE-----