Re: Error while executing a view in postgres 10.5

From: "Jonathan S(dot) Katz" <jonathan(dot)katz(at)excoventures(dot)com>
To: pavan95 <pavan(dot)postgresdba(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Error while executing a view in postgres 10.5
Date: 2019-03-22 13:08:38
Message-ID: 7D22B6B0-E502-41EE-93FD-A649B1C31144@excoventures.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message github kran 2019-03-29 04:13:31 Archival process of partition tables with filtering few rows from tables.
Previous Message pavan95 2019-03-22 11:26:04 Re: Error while executing a view in postgres 10.5