Skip to content

Commit 3ab470c

Browse files
RekGRpthclaude
andcommitted
fix: remove dead pg_conf.close/pg_work.close GUCs
Both were registered (DefineCustomIntVariable) and documented, but init.conf.close/init.work.close were never read anywhere - no C accessor, no current_setting('pg_conf.close'/'pg_work.close') in any generated SQL. Audited every other registered GUC the same way (C accessor or current_setting() reference) and confirmed nothing else in the set is similarly unused. Setting either had always been a silent no-op; removing them is a one-time cosmetic break for anyone who had them in a config file (they'll get "unrecognized configuration parameter" on upgrade) in exchange for not documenting and shipping controls that do nothing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent a09e896 commit 3ab470c

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ INSERT INTO task (input, remote) VALUES ('SELECT now()', 'user=user host=host');
2626
| pg_task.save | bool | false | config, database, user, session | Save session state between tasks |
2727
| pg_task.spi | bool | false | config, database, user, session | SPI (or local) execution? |
2828
| pg_task.string | bool | true | config, database, user, session | Quote only strings |
29-
| pg_conf.close | int | 60 * 1000 | config, database, superuser | Close conf, milliseconds |
3029
| pg_conf.fetch | int | 10 | config, database, superuser | Fetch conf rows at once |
3130
| pg_conf.max | int | max_worker_processes | config | Maximum task and work workers |
3231
| pg_conf.restart | int | 60 | config, database, superuser | Restart conf interval, seconds |
@@ -37,7 +36,6 @@ INSERT INTO task (input, remote) VALUES ('SELECT now()', 'user=user host=host');
3736
| pg_task.max | int | 0 | config, database, user, session | Maximum count of concurrently executing tasks in group, negative value means pause between tasks in milliseconds |
3837
| pg_task.run | int | 2147483647 | config, database, user, session | Maximum count of concurrently executing tasks in work |
3938
| pg_task.sleep | int | 1000 | config, database, user | Check tasks every sleep milliseconds |
40-
| pg_work.close | int | 60 * 1000 | config, database, superuser | Close work, milliseconds |
4139
| pg_work.fetch | int | 100 | config, database, superuser | Fetch work rows at once |
4240
| pg_work.idle | int | 60 | config, database, user | Idle work count |
4341
| pg_work.restart | int | 60 | config, database, superuser | Restart work interval, seconds |

init.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static struct {
2323
char *null;
2424
char *plan;
2525
struct {
26-
int close;
2726
int fetch;
2827
int max;
2928
int restart;
@@ -58,7 +57,6 @@ static struct {
5857
int sleep;
5958
} task;
6059
struct {
61-
int close;
6260
int fetch;
6361
int idle;
6462
int restart;
@@ -218,7 +216,6 @@ void _PG_init(void) {
218216
DefineCustomBoolVariable("pg_task.save", "pg_task save", "Save session state between tasks", &init.task.save, false, PGC_USERSET, 0, NULL, NULL, NULL);
219217
DefineCustomBoolVariable("pg_task.spi", "pg_task spi", "SPI (or local) execution?", &init.task.spi, false, PGC_USERSET, 0, NULL, NULL, NULL);
220218
DefineCustomBoolVariable("pg_task.string", "pg_task string", "Quote only strings", &init.task.string, true, PGC_USERSET, 0, NULL, NULL, NULL);
221-
DefineCustomIntVariable("pg_conf.close", "pg_conf close", "Close conf, milliseconds", &init.conf.close, BGW_DEFAULT_RESTART_INTERVAL * 1000, 1, INT_MAX, PGC_SUSET, 0, NULL, NULL, NULL);
222219
DefineCustomIntVariable("pg_conf.fetch", "pg_conf fetch", "Fetch conf rows at once", &init.conf.fetch, 10, 1, INT_MAX, PGC_SUSET, 0, NULL, NULL, NULL);
223220
DefineCustomIntVariable("pg_conf.max", "pg_conf work", "Maximum task and work workers", &init.conf.max, max_worker_processes, 1, max_worker_processes, PGC_POSTMASTER, 0, NULL, NULL, NULL);
224221
DefineCustomIntVariable("pg_conf.restart", "pg_conf restart", "Restart conf interval, seconds", &init.conf.restart, BGW_DEFAULT_RESTART_INTERVAL, 1, INT_MAX, PGC_SUSET, 0, NULL, NULL, NULL);
@@ -228,7 +225,6 @@ void _PG_init(void) {
228225
DefineCustomIntVariable("pg_task.max", "pg_task max", "Maximum count of concurrently executing tasks in group, negative value means pause between tasks in milliseconds", &init.task.max, 0, INT_MIN, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);
229226
DefineCustomIntVariable("pg_task.run", "pg_task run", "Maximum count of concurrently executing tasks in work", &init.task.run, INT_MAX, 1, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);
230227
DefineCustomIntVariable("pg_task.sleep", "pg_task sleep", "Check tasks every sleep milliseconds", &init.task.sleep, 1000, 1, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);
231-
DefineCustomIntVariable("pg_work.close", "pg_work close", "Close work, milliseconds", &init.work.close, BGW_DEFAULT_RESTART_INTERVAL * 1000, 1, INT_MAX, PGC_SUSET, 0, NULL, NULL, NULL);
232228
DefineCustomIntVariable("pg_work.fetch", "pg_work fetch", "Fetch work rows at once", &init.work.fetch, 100, 1, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);
233229
DefineCustomIntVariable("pg_work.idle", "pg_work idle", "Idle work count", &init.work.idle, BGW_DEFAULT_RESTART_INTERVAL, 1, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);
234230
DefineCustomIntVariable("pg_work.restart", "pg_work restart", "Restart work interval, seconds", &init.work.restart, BGW_DEFAULT_RESTART_INTERVAL, 1, INT_MAX, PGC_USERSET, 0, NULL, NULL, NULL);

0 commit comments

Comments
 (0)