| From: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: pg_hosts: Add pg_hosts_file_rules() |
| Date: | 2026-07-15 13:56:15 |
| Message-ID: | DC7CAEC4-5273-49B5-B5CD-197E869503B0@yesql.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On 14 Jul 2026, at 17:32, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
>> I think it's a good idea to add this. One thing I have been puzzling over is
>> what to do with LibreSSL builds which don't support ssl_sni. One could argue
>> that parsing the file doesn't require ssl_sni actually function, so the view
>> could still work, but on the other hand it might be confusing to users to learn
>> that their file doesn't generate any errors yet ssl_sni doesn't work. I think
>> I prefer if the view is blank and the file isn't parsed in clusters which
>> doesn't support ssl_sni. What are your thoughts on that?
>
> I agree, I was already thinking about this in more general ways as
> part of the config rework (what else could be in pg_hosts), but for
> the context of this patch it's better to limit it similarly to the
> main feature.
+1
> Should I also try to add a liressl specific test to it?
If you can find a good way to do it without convoluting the testfile which
currently just does a skip_all in case of LibreSSL, then why not. If it reduce
readability of the test file then it's probably not worth it since it's not
using any different codepaths from the OpenSSL counterpart.
>> This test doesn't need the ->reload command here does it, since the view parses
>> whats on the filesystem and not what's running. Also, since we know the view
>> shall have a single row with an error we should test for == 1 instead of >= 1.
>> Similarily, the previous test doesn't need to restart the cluster?
>
> The first is needed, or we need at least start, as postgres is stopped
> before it (previous test fails the restart).
Ah, of course. However, it would be nice to avoid another restart in order to
shave some time off the testrun. Since these tests aren't really affecting the
cluster state, how about placing them first in the pg_hosts.conf section
starting at at line 98. That way we can test various queries against this view
when the cluster is running before we start with tests that load pg_hosts.conf.
It also makes more sense to me to first test parsing, and then parsing+loading.
--
Daniel Gustafsson
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniel Gustafsson | 2026-07-15 14:02:31 | Re: Remove the refint contrib module (for v20) |
| Previous Message | Ayush Tiwari | 2026-07-15 13:47:39 | Re: Remove the refint contrib module (for v20) |