diff --git a/expected/epochprop.out b/expected/epochprop.out index 74e4253..1111f1a 100644 --- a/expected/epochprop.out +++ b/expected/epochprop.out @@ -30,7 +30,7 @@ FROM ( -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- - 269.4744079540 | 4.4055337210 | .000 | -801.210 | 10361.762 | -###.### + 269.4744079540 | 4.4055337210 | .000 | -801.210 | 10361.762 | -110.000 (1 row) SELECT diff --git a/src/epochprop.c b/src/epochprop.c index 37aab5d..12ad621 100644 --- a/src/epochprop.c +++ b/src/epochprop.c @@ -177,11 +177,11 @@ epoch_prop(PG_FUNCTION_ARGS) { propagate_phasevec(&input, delta_t, &output); - /* If we have a null parallax but a good RV, preserve the original, + /* If we have an invalid parallax but a good RV, preserve the original, untransformed RV on output. See https://github.com/ivoa-std/udf-catalogue/pull/20#issuecomment-2115053757 for the rationale. */ - if (!PG_ARGISNULL(4) && PG_ARGISNULL(1)) { + if (!PG_ARGISNULL(4) && !input.parallax_valid) { output_null[5] = 0; output.rv = input.rv; }