diff options
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 332b4a5cdeb..f8461bf18dc 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -5204,10 +5204,11 @@ postgresAcquireSampleRowsFunc(Relation relation, int elevel, sample_frac = targrows / reltuples; /* - * Ensure the sampling rate is between 0.0 and 1.0, even after the - * 10% adjustment above. (Clamping to 0.0 is just paranoia.) + * We should never get sampling rate outside the valid range + * (between 0.0 and 1.0), because those cases should be covered + * by the previous branch that sets ANALYZE_SAMPLE_OFF. */ - sample_frac = Min(1.0, Max(0.0, sample_frac)); + Assert(sample_frac >= 0.0 && sample_frac <= 1.0); } } |