Re: stawidth inconsistency with all NULL columns

2019-05-21 Thread Tom Lane
Joe Conway writes: > On 5/21/19 3:55 PM, Tom Lane wrote: >> Are you suggesting that we should set stawidth to zero even for a >> fixed-width datatype? That seems pretty silly. We know exactly what >> the value should be, and would be if we'd chanced to find even one >> non-null entry. > Well yo

Re: stawidth inconsistency with all NULL columns

2019-05-21 Thread Joe Conway
On 5/21/19 3:55 PM, Tom Lane wrote: > Joe Conway writes: >> else if (null_cnt > 0) >> { >> /* We found only nulls; assume the column is entirely null */ >> stats->stats_valid = true; >> stats->stanullfrac = 1.0; >> if (is_varwidth) >> stats->stawidth = 0;/* "unknown" */

Re: stawidth inconsistency with all NULL columns

2019-05-21 Thread Tom Lane
Joe Conway writes: > else if (null_cnt > 0) > { > /* We found only nulls; assume the column is entirely null */ > stats->stats_valid = true; > stats->stanullfrac = 1.0; > if (is_varwidth) > stats->stawidth = 0;/* "unknown" */ > else > stats->stawidth = stats