pgsql-http
pgsql-http copied to clipboard
Return to GUC for CURL options?
The GUC system doesn't require the variable names to be preconfigured if they are under a prefix, so the following works:
http=# set http.foobar = 'this';
SET
http=# show http.foobar;
http.foobar
-------------
this
(1 row)
In combination with this PostgreSQL function
const char *
GetConfigOption(const char *name, bool missing_ok, bool restrict_privileged)
It should be possible to just have GUC variables for all the CURL opts we want to support. This wouldn't allow arbitrary CURL option setting, as only options we allowed in the code would be available.
It would then be possible to persist option setting over multiple sessions:
alter database http set http.fooBar = 126;
Note that the GUC names are case insensitive, so that quirk is automatically handled for us too. Kind of wish I had done this to start with.