PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16254
PG Version10.5
OSCentOS Linux release 7.5.1804 (Core)
Opened2020-02-11 12:34:28+00
Reported byАлексей Божков
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16254
Logged by:          Алексей Божков
Email address:      (redacted)
PostgreSQL version: 10.5
Operating system:   CentOS Linux release 7.5.1804 (Core)
Description:        

After refactoring of a SQL query during run of new version of the query
given below 
select count( distinct case when proc_error_cd = '000' then 'ok@' end ||
muid || '@' || email ),
count( distinct case when proc_error_cd = '000' then null else 'err@' end ||
muid || '@' || email )
 into v_in_cnt, v_in_cnt_err
from cb.T co
where  check_dt_msk between v_check_dt_min and v_check_dt_max
and cashback <> 0
and calc_batch_id = any(v_calc_batch_id_ar)
and muid = any (v_muid_ar);

where 
v_muid_ar, v_calc_batch_id_ar - are arrays of (183 and 4167 scalar elements
populated below)
select array_agg(distinct muid)
  into v_muid_ar
  from cb.rsp_tst
  where txncode in ('29', '18')
  and tsid::int = v_tsid;

  select array_agg(distinct calc_batch_id)
  into v_calc_batch_id_ar
  from cbf.calc_batch_dt_range
  where batch_group_id = v_tsid;
I got error dsa_allocate could not find 4 free pages

Old version of query runs without errors:
select count( distinct case when proc_error_cd = '000' then 'ok@' end ||
muid || '@' || email ),
                       count( distinct case when proc_error_cd = '000' then
null else 'err@' end || muid || '@' || email )
                    into v_in_cnt, v_in_cnt_err
                    from cb.T co, cbf.calc_batch_dt_range rn
                    where 1=1
                      and check_dt_msk between v_check_dt_min and
v_check_dt_max
                      and cashback <> 0
                      and co.calc_batch_id = rn.calc_batch_id
                      and batch_group_id = v_tsid
                      and muid in ( select  unnest ( v_muid_ar ) );

cb.T is a view of a few mln rows

Messages

DateAuthorSubject
2020-02-11 12:34:28+00PG Bug reporting formBUG #16254: SQL raises error dsa_allocate could not find 4 free pages
2020-02-11 19:23:59+00Thomas MunroRe: BUG #16254: SQL raises error dsa_allocate could not find 4 free pages