pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.7k stars 249 forks source link

Imply `NOT_IN_SAMPLE` for `GucFlags::NO_SHOW_ALL` #1925

Closed Ngalstyan4 closed 4 weeks ago

Ngalstyan4 commented 1 month ago

Hi all,

firstly, thanks for giving pgrx to the world!

We use pgrx at Lantern^0 and when configuring GUCs noticed a small issue with GUC flags. Postgres requires GUC_NOT_IN_SAMPLE GUC flag to be set whenever NO_SHOW_ALL is set^1. Make applying GucFlags::NO_SHOW_ALL also apply NOT_IN_SAMPLE, as NOT_IN_SAMPLE cannot be set.

After applying this diff, we no longer have a direct name matching between pgrx GUC names and postgres ones. An alternative might be to deprecate NO_SHOW_ALL and introduce something like NO_SHOW_ALL_AND_NO_SAMPLE, but not sure if it is worth it.

workingjubilee commented 4 weeks ago

@Ngalstyan4 your "source" link doesn't work at all, it seems.

Ngalstyan4 commented 4 weeks ago

sorry, this is what I was referring to: https://github.com/postgres/postgres/blob/dbedc461b4e7a9cb4d6f5777174bdf180edb95fd/src/backend/utils/misc/guc.c#L1506-L1519

Fixed the link in the description above as well.

workingjubilee commented 4 weeks ago

Thank you.

...I wonder why they don't just make one flag imply... well, anyway.