Giter Site home page Giter Site logo

count_distinct's People

Contributors

bashtanov avatar rattrayalex avatar theory avatar tvondra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

count_distinct's Issues

Test Failures

On Postgres 10, regression.diffs:

*** /Users/david/dev/pgxn/count_distinct/test/expected/array_agg.out	2018-11-12 13:09:22.000000000 -0500
--- /Users/david/dev/pgxn/count_distinct/results/array_agg.out	2018-11-12 13:12:14.000000000 -0500
***************
*** 1,174 ****
  \set ECHO none
  -- int
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(x::int)) a FROM test_data_1_50)_;
!                                                                    array_agg                                                                    
! ------------------------------------------------------------------------------------------------------------------------------------------------
!  {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50}
! (1 row)
! 
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(mod(x,10)::int)) a FROM test_data_1_50)_;
!        array_agg       
! -----------------------
!  {0,1,2,3,4,5,6,7,8,9}
! (1 row)
! 
  -- bigint
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(x::bigint)) a FROM test_data_1_50)_;
!                                                                    array_agg                                                                    
! ------------------------------------------------------------------------------------------------------------------------------------------------
!  {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50}
! (1 row)
! 
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(mod(x,10)::bigint)) a FROM test_data_1_50)_;
!        array_agg       
! -----------------------
!  {0,1,2,3,4,5,6,7,8,9}
! (1 row)
! 
  -- timestamp
  SELECT unnest(array_agg(a order by a)) FROM (SELECT unnest(array_agg_distinct('epoch'::timestamp + (x || ' days')::interval)) a FROM test_data_1_50)_;
!           unnest          
! --------------------------
!  Fri Jan 02 00:00:00 1970
!  Sat Jan 03 00:00:00 1970
!  Sun Jan 04 00:00:00 1970
!  Mon Jan 05 00:00:00 1970
!  Tue Jan 06 00:00:00 1970
!  Wed Jan 07 00:00:00 1970
!  Thu Jan 08 00:00:00 1970
!  Fri Jan 09 00:00:00 1970
!  Sat Jan 10 00:00:00 1970
!  Sun Jan 11 00:00:00 1970
!  Mon Jan 12 00:00:00 1970
!  Tue Jan 13 00:00:00 1970
!  Wed Jan 14 00:00:00 1970
!  Thu Jan 15 00:00:00 1970
!  Fri Jan 16 00:00:00 1970
!  Sat Jan 17 00:00:00 1970
!  Sun Jan 18 00:00:00 1970
!  Mon Jan 19 00:00:00 1970
!  Tue Jan 20 00:00:00 1970
!  Wed Jan 21 00:00:00 1970
!  Thu Jan 22 00:00:00 1970
!  Fri Jan 23 00:00:00 1970
!  Sat Jan 24 00:00:00 1970
!  Sun Jan 25 00:00:00 1970
!  Mon Jan 26 00:00:00 1970
!  Tue Jan 27 00:00:00 1970
!  Wed Jan 28 00:00:00 1970
!  Thu Jan 29 00:00:00 1970
!  Fri Jan 30 00:00:00 1970
!  Sat Jan 31 00:00:00 1970
!  Sun Feb 01 00:00:00 1970
!  Mon Feb 02 00:00:00 1970
!  Tue Feb 03 00:00:00 1970
!  Wed Feb 04 00:00:00 1970
!  Thu Feb 05 00:00:00 1970
!  Fri Feb 06 00:00:00 1970
!  Sat Feb 07 00:00:00 1970
!  Sun Feb 08 00:00:00 1970
!  Mon Feb 09 00:00:00 1970
!  Tue Feb 10 00:00:00 1970
!  Wed Feb 11 00:00:00 1970
!  Thu Feb 12 00:00:00 1970
!  Fri Feb 13 00:00:00 1970
!  Sat Feb 14 00:00:00 1970
!  Sun Feb 15 00:00:00 1970
!  Mon Feb 16 00:00:00 1970
!  Tue Feb 17 00:00:00 1970
!  Wed Feb 18 00:00:00 1970
!  Thu Feb 19 00:00:00 1970
!  Fri Feb 20 00:00:00 1970
! (50 rows)
! 
  SELECT unnest(array_agg(a order by a)) FROM (SELECT unnest(array_agg_distinct('epoch'::timestamptz + (x || ' days')::interval)) a FROM test_data_1_50)_;
!             unnest            
! ------------------------------
!  Thu Jan 01 16:00:00 1970 PST
!  Fri Jan 02 16:00:00 1970 PST
!  Sat Jan 03 16:00:00 1970 PST
!  Sun Jan 04 16:00:00 1970 PST
!  Mon Jan 05 16:00:00 1970 PST
!  Tue Jan 06 16:00:00 1970 PST
!  Wed Jan 07 16:00:00 1970 PST
!  Thu Jan 08 16:00:00 1970 PST
!  Fri Jan 09 16:00:00 1970 PST
!  Sat Jan 10 16:00:00 1970 PST
!  Sun Jan 11 16:00:00 1970 PST
!  Mon Jan 12 16:00:00 1970 PST
!  Tue Jan 13 16:00:00 1970 PST
!  Wed Jan 14 16:00:00 1970 PST
!  Thu Jan 15 16:00:00 1970 PST
!  Fri Jan 16 16:00:00 1970 PST
!  Sat Jan 17 16:00:00 1970 PST
!  Sun Jan 18 16:00:00 1970 PST
!  Mon Jan 19 16:00:00 1970 PST
!  Tue Jan 20 16:00:00 1970 PST
!  Wed Jan 21 16:00:00 1970 PST
!  Thu Jan 22 16:00:00 1970 PST
!  Fri Jan 23 16:00:00 1970 PST
!  Sat Jan 24 16:00:00 1970 PST
!  Sun Jan 25 16:00:00 1970 PST
!  Mon Jan 26 16:00:00 1970 PST
!  Tue Jan 27 16:00:00 1970 PST
!  Wed Jan 28 16:00:00 1970 PST
!  Thu Jan 29 16:00:00 1970 PST
!  Fri Jan 30 16:00:00 1970 PST
!  Sat Jan 31 16:00:00 1970 PST
!  Sun Feb 01 16:00:00 1970 PST
!  Mon Feb 02 16:00:00 1970 PST
!  Tue Feb 03 16:00:00 1970 PST
!  Wed Feb 04 16:00:00 1970 PST
!  Thu Feb 05 16:00:00 1970 PST
!  Fri Feb 06 16:00:00 1970 PST
!  Sat Feb 07 16:00:00 1970 PST
!  Sun Feb 08 16:00:00 1970 PST
!  Mon Feb 09 16:00:00 1970 PST
!  Tue Feb 10 16:00:00 1970 PST
!  Wed Feb 11 16:00:00 1970 PST
!  Thu Feb 12 16:00:00 1970 PST
!  Fri Feb 13 16:00:00 1970 PST
!  Sat Feb 14 16:00:00 1970 PST
!  Sun Feb 15 16:00:00 1970 PST
!  Mon Feb 16 16:00:00 1970 PST
!  Tue Feb 17 16:00:00 1970 PST
!  Wed Feb 18 16:00:00 1970 PST
!  Thu Feb 19 16:00:00 1970 PST
! (50 rows)
! 
  -- bool
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(mod(x,2)::bool)) a FROM test_data_1_50)_;
!  array_agg 
! -----------
!  {f,t}
! (1 row)
! 
  -- bool w/nulls
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(nullif(mod(x,2), 0)::bool)) a FROM test_data_0_50)_;
!  array_agg 
! -----------
!  {t}
! (1 row)
! 
  -- int2
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(x::int2)) a FROM test_data_1_50)_;
!                                                                    array_agg                                                                    
! ------------------------------------------------------------------------------------------------------------------------------------------------
!  {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50}
! (1 row)
! 
  -- array_agg_elements: nulls only
  SELECT array_agg_distinct_elements(array[null::int2]) a FROM generate_series(1, 10) x;
!  a  
! ----
!  {}
! (1 row)
! 
  -- array_agg_elements: nulls and non-nulls
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct_elements(array[x::int2, null, -x::int2])) a FROM test_data_0_50)_;
!                                                                                                                                                                     array_agg                                                                                                                                                                    
! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
!  {-50,-49,-48,-47,-46,-45,-44,-43,-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50}
! (1 row)
! 
  ROLLBACK;
--- 1,38 ----
  \set ECHO none
+ psql:test/sql/setup/setup.sql:40: ERROR:  unrecognized configuration parameter "min_parallel_relation_size"
+ CONTEXT:  SQL statement "SELECT set_config('min_parallel_relation_size', '0', true),
+             set_config('parallel_setup_cost', '0', true),
+             set_config('parallel_tuple_cost', '0', true),
+             set_config('max_parallel_workers_per_gather', '22', true)"
+ PL/pgSQL function inline_code_block line 5 at PERFORM
  -- int
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(x::int)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(mod(x,10)::int)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- bigint
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(x::bigint)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(mod(x,10)::bigint)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- timestamp
  SELECT unnest(array_agg(a order by a)) FROM (SELECT unnest(array_agg_distinct('epoch'::timestamp + (x || ' days')::interval)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT unnest(array_agg(a order by a)) FROM (SELECT unnest(array_agg_distinct('epoch'::timestamptz + (x || ' days')::interval)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- bool
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(mod(x,2)::bool)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- bool w/nulls
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(nullif(mod(x,2), 0)::bool)) a FROM test_data_0_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- int2
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct(x::int2)) a FROM test_data_1_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array_agg_elements: nulls only
  SELECT array_agg_distinct_elements(array[null::int2]) a FROM generate_series(1, 10) x;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array_agg_elements: nulls and non-nulls
  SELECT array_agg(a order by a) FROM (SELECT unnest(array_agg_distinct_elements(array[x::int2, null, -x::int2])) a FROM test_data_0_50)_;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  ROLLBACK;

======================================================================

*** /Users/david/dev/pgxn/count_distinct/test/expected/base.out	2018-11-12 13:09:22.000000000 -0500
--- /Users/david/dev/pgxn/count_distinct/results/base.out	2018-11-12 13:12:14.000000000 -0500
***************
*** 1,152 ****
  \set ECHO none
  -- int
  SELECT count_distinct(x::int) FROM test_data_1_1000;
!  count_distinct 
! ----------------
!            1000
! (1 row)
! 
  SELECT count_distinct(mod(x,10)::int) FROM test_data_1_1000;
!  count_distinct 
! ----------------
!              10
! (1 row)
! 
  -- bigint
  SELECT count_distinct(x::bigint) FROM test_data_1_1000;
!  count_distinct 
! ----------------
!            1000
! (1 row)
! 
  SELECT count_distinct(mod(x,10)::bigint) FROM test_data_1_1000;
!  count_distinct 
! ----------------
!              10
! (1 row)
! 
  -- timestamp
  select count_distinct(now()::timestamp + (x || ' days')::interval) from test_data_1_1000;
!  count_distinct 
! ----------------
!            1000
! (1 row)
! 
  select count_distinct(now() + (x || ' days')::interval) from test_data_1_1000;
!  count_distinct 
! ----------------
!            1000
! (1 row)
! 
  -- bool
  select count_distinct(x::bool) from test_data_0_1000;
!  count_distinct 
! ----------------
!               2
! (1 row)
! 
  -- int2
  select count_distinct(x::int2) from test_data_1_1000;
!  count_distinct 
! ----------------
!            1000
! (1 row)
! 
  -- array of int
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[x::int, (x+1)::int] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                     1001
! (1 row)
! 
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::int, mod(x+1,10)::int] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                       10
! (1 row)
! 
  -- array of bigint
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[x::bigint, (x+1)::bigint] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                     1001
! (1 row)
! 
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::bigint, mod(x+1,10)::bigint] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                       10
! (1 row)
! 
  -- array of timestamp
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[now()::timestamp + (x || ' days')::interval,
                   now()::timestamp + ((x + 1) || ' days')::interval] AS z
      FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                     1001
! (1 row)
! 
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[now() + (x || ' days')::interval,
                   now() + ((x + 1) || ' days')::interval] AS z
      FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                     1001
! (1 row)
! 
  -- array of bool
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[x::bool, (x+1)::bool] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                        1
! (1 row)
! 
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::bool, mod(x+1,10)::bool] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                        2
! (1 row)
! 
  -- array of int2 with nulls
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[NULL, NULL, NULL, NULL]::int2[] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                         
! (1 row)
! 
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[[NULL, x::int2, NULL], [NULL, (x+1)::int2, NULL]] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                     1001
! (1 row)
! 
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::int2, mod(x+1,10)::int2] AS z FROM generate_series(1,1000) s(x)
  ) foo;
!  count_distinct_elements 
! -------------------------
!                       10
! (1 row)
! 
  ROLLBACK;
--- 1,82 ----
  \set ECHO none
+ psql:test/sql/setup/setup.sql:40: ERROR:  unrecognized configuration parameter "min_parallel_relation_size"
+ CONTEXT:  SQL statement "SELECT set_config('min_parallel_relation_size', '0', true),
+             set_config('parallel_setup_cost', '0', true),
+             set_config('parallel_tuple_cost', '0', true),
+             set_config('max_parallel_workers_per_gather', '22', true)"
+ PL/pgSQL function inline_code_block line 5 at PERFORM
  -- int
  SELECT count_distinct(x::int) FROM test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct(mod(x,10)::int) FROM test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- bigint
  SELECT count_distinct(x::bigint) FROM test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct(mod(x,10)::bigint) FROM test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- timestamp
  select count_distinct(now()::timestamp + (x || ' days')::interval) from test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  select count_distinct(now() + (x || ' days')::interval) from test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- bool
  select count_distinct(x::bool) from test_data_0_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- int2
  select count_distinct(x::int2) from test_data_1_1000;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array of int
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[x::int, (x+1)::int] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::int, mod(x+1,10)::int] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array of bigint
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[x::bigint, (x+1)::bigint] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::bigint, mod(x+1,10)::bigint] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array of timestamp
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[now()::timestamp + (x || ' days')::interval,
                   now()::timestamp + ((x + 1) || ' days')::interval] AS z
      FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[now() + (x || ' days')::interval,
                   now() + ((x + 1) || ' days')::interval] AS z
      FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array of bool
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[x::bool, (x+1)::bool] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::bool, mod(x+1,10)::bool] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  -- array of int2 with nulls
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[NULL, NULL, NULL, NULL]::int2[] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[[NULL, x::int2, NULL], [NULL, (x+1)::int2, NULL]] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  SELECT count_distinct_elements(z) FROM (
      SELECT ARRAY[mod(x,10)::int2, mod(x+1,10)::int2] AS z FROM generate_series(1,1000) s(x)
  ) foo;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  ROLLBACK;

======================================================================

*** /Users/david/dev/pgxn/count_distinct/test/expected/window.out	2018-11-12 13:09:22.000000000 -0500
--- /Users/david/dev/pgxn/count_distinct/results/window.out	2018-11-12 13:12:14.000000000 -0500
***************
*** 1,59 ****
  \set ECHO none
  select count_distinct(x) over (order by x rows between unbounded preceding and current row)
    from test_data_1_20;
!  count_distinct 
! ----------------
!               1
!               2
!               3
!               4
!               5
!               6
!               7
!               8
!               9
!              10
!              11
!              12
!              13
!              14
!              15
!              16
!              17
!              18
!              19
!              20
! (20 rows)
! 
  select count_distinct(x) over (order by x rows between 10 preceding and 10 following)
    from test_data_1_25;
!  count_distinct 
! ----------------
!              11
!              12
!              13
!              14
!              15
!              16
!              17
!              18
!              19
!              20
!              21
!              21
!              21
!              21
!              21
!              20
!              19
!              18
!              17
!              16
!              15
!              14
!              13
!              12
!              11
! (25 rows)
! 
  ROLLBACK;
--- 1,14 ----
  \set ECHO none
+ psql:test/sql/setup/setup.sql:40: ERROR:  unrecognized configuration parameter "min_parallel_relation_size"
+ CONTEXT:  SQL statement "SELECT set_config('min_parallel_relation_size', '0', true),
+             set_config('parallel_setup_cost', '0', true),
+             set_config('parallel_tuple_cost', '0', true),
+             set_config('max_parallel_workers_per_gather', '22', true)"
+ PL/pgSQL function inline_code_block line 5 at PERFORM
  select count_distinct(x) over (order by x rows between unbounded preceding and current row)
    from test_data_1_20;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  select count_distinct(x) over (order by x rows between 10 preceding and 10 following)
    from test_data_1_25;
! ERROR:  current transaction is aborted, commands ignored until end of transaction block
  ROLLBACK;

======================================================================

`make` Fails on PostgreSQL 11 with LLVM JIT Support

+ make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/count_distinct.o src/count_distinct.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -fPIC -shared -o count_distinct.so src/count_distinct.o -L/usr/pgsql-11/lib  -Wl,--as-needed -L/usr/lib64/llvm5.0/lib  -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-11/lib',--enable-new-dtags  
make: *** No rule to make target `count_distinct.bc', needed by `all'.  Stop.

Not sure where the count_distinct.bc target is coming from. :-(

Connection lost when using count_distinct

Hi,

I just try to use your extension. After install, when I try to use it, I get the following error:

The connection to the server was lost. Attempting reset: Failed.

I use Postgres 9.3.5 installed with Homebrew on OS X Yosemite.

The query is:

SELECT count_distinct(created_collection) FROM fetcheddata_contract;

where created_collection is a bigint(8).

I've try with other columns from int(2) to int(8) with the same error.

Any advice?

Regards,

Goulwen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.