Hi,

A DSS developer from my company, Julien Roze, reported me an error I cannot 
explained. Is it a new behavior or a bug ?

Original query is much more complicated but here is a simplified test case with 
postgresql 14 and 15 beta 2 on Debian 11, packages from pgdg :

Ver Cluster Port Status Owner    Data directory              Log file
14  main    5432 online postgres /var/lib/postgresql/14/main 
/var/log/postgresql/postgresql-14-main.log
15  main    5433 online postgres /var/lib/postgresql/15/main 
/var/log/postgresql/postgresql-15-main.log

psql -p 5432

select version();
                                                           version              
                                             
-----------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 14.4 (Debian 14.4-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by 
gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
(1 ligne)


with fakedata as (
               select 'hello' word
               union all
               select 'world' word
)
select *
from (
               select word, count(*) over (partition by word) nb from fakedata
) t where nb = 1;
 
  word  | nb 
-------+----
 hello |  1
 world |  1
(2 lignes)


with fakedata as (
               select 'hello' word
               union all
               select 'world' word
)
select *
from (
               select word, count(*) nb from fakedata group by word
) t where nb = 1;
 
  word  | nb 
-------+----
 hello |  1
 world |  1
(2 lignes)

psql -p 5433

 select version();
                                                              version           
                                                    
------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 15beta2 (Debian 15~beta2-1.pgdg110+1) on x86_64-pc-linux-gnu, 
compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
(1 ligne)

with fakedata as (
               select 'hello' word
               union all
               select 'world' word
)
select *
from (
               select word, count(*) over (partition by word) nb from fakedata
) t where nb = 1;
ERREUR:  cache lookup failed for function 0

with fakedata as (
               select 'hello' word
               union all
               select 'world' word
)
select *
from (
               select word, count(*) nb from fakedata group by word
) t where nb = 1;
 
 word  | nb 
-------+----
 hello |  1
 world |  1
(2 lignes)


Best regards,
Phil

Reply via email to