pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14969: Delta in 9.6 and 10
2+ messages / 2 participants
[nested] [flat]

* BUG #14969: Delta in 9.6 and 10
@ 2017-12-12 16:09  mohanpatil048@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: mohanpatil048@gmail.com @ 2017-12-12 16:09 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: mohanpatil048@gmail.com

The following bug has been logged on the website:

Bug reference:      14969
Logged by:          Mohan Patil
Email address:      mohanpatil048@gmail.com
PostgreSQL version: 10.1
Operating system:   ubuntu 14.04
Description:        

When I execute the below query in 9.6 version,I get the result.

But when I execute it on 10.1, it is giving the error,

********** Error **********

ERROR: set-returning functions are not allowed in CASE
SQL state: 0A000
Hint: You might be able to move the set-returning function into a LATERAL
FROM item.

QUERY::
 SELECT t.id, t.name
FROM (SELECT ( CASE
             WHEN CARDINALITY(tier_ids) > 1 THEN UNNEST(tier_ids)
             ELSE NULL
             END ) AS tier_id
      FROM   relation
      WHERE  id = 1001) AS d
 INNER JOIN tier t ON t.id = d.tier_id ;






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #14969: Delta in 9.6 and 10
@ 2017-12-12 17:38  David G. Johnston <david.g.johnston@gmail.com>
  parent: mohanpatil048@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: David G. Johnston @ 2017-12-12 17:38 UTC (permalink / raw)
  To: mohanpatil048@gmail.com <mohanpatil048@gmail.com>; +Cc: pgsql-bugs

On Tuesday, December 12, 2017, <mohanpatil048@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14969
> Logged by:          Mohan Patil
> Email address:      mohanpatil048@gmail.com
> PostgreSQL version: 10.1
> Operating system:   ubuntu 14.04
> Description:
>
> When I execute the below query in 9.6 version,I get the result.
>
> But when I execute it on 10.1, it is giving the error,
>
> ********** Error **********
>
> ERROR: set-returning functions are not allowed in CASE
> SQL state: 0A000
> Hint: You might be able to move the set-returning function into a LATERAL
> FROM item.
>
> QUERY::
>  SELECT t.id, t.name
> FROM (SELECT ( CASE
>              WHEN CARDINALITY(tier_ids) > 1 THEN UNNEST(tier_ids)
>              ELSE NULL
>              END ) AS tier_id
>       FROM   relation
>       WHERE  id = 1001) AS d
>  INNER JOIN tier t ON t.id = d.tier_id ;
>
>
This is not a bug and while I cannot rewrite the query for you the
suggestion provided by the system is a valid one you should consider
following.  E same query you end up with in 10 will continue to work with
9.6.

David J.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-12-12 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 16:09 BUG #14969: Delta in 9.6 and 10 mohanpatil048@gmail.com
2017-12-12 17:38 ` David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox