| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Nikolay Shaplov <dhyan(at)nataraj(dot)su> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Chris Travers <chris(dot)travers(at)gmail(dot)com>, Timur Magomedov <t(dot)magomedov(at)postgrespro(dot)ru>, Nathan Bossart <nathandbossart(at)gmail(dot)com> |
| Subject: | Re: [PATCH] ternary reloption type |
| Date: | 2026-08-17 13:03:12 |
| Message-ID: | 3b230dc4-9495-46b6-8634-e04f9833d45e@eisentraut.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 21.01.26 20:23, Álvaro Herrera wrote:
> On 2026-Jan-21, Nikolay Shaplov wrote:
>
>> On 16.01.2026 18:14, Álvaro Herrera wrote:
>>> I took a quick look at 0001+0002 and I think it's quite reasonable.
>>> Here it is again with some minor fixups.
>> Good. I like ternary -> pg_ternary change. That is reasonable. And
>> postgres.h is better place for it then c.h.
> I further changed TERNARY_TRUE and so on to have a PG_ prefix also; it's
> not impossible that there's userland code somewhere outside Postgres
> that uses those symbol names, so let's avoid a collision.
I don't like that pg_ternary was added to postgres.h.
There are, depending on how you count, a few to many other ternary types
used throughout the tree, and it's not clear why this one should be the
standard one now. At least if so that should have involved some
discussion and analysis on the other ones. There are also some
tradeoffs about how this type should be designed. This particular one
uses 0 and 1 for false and true, and -1 for unset. Others use 0 for
unset and other values for false and true. Maybe this choice is useful
for this particular use, but we shouldn't impose it on everyone.
Independent of that, I don't understand why this was put into postgres.h
instead of c.h. It's not particular to backend code, as far as I can tell.
I think it would be better to rename this to something like
relopt_ternary and move it to access/reloptions.h.
If we want to consolidate all ternary types, that might be useful, but
it should be an explicit discussion.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Langote | 2026-08-17 13:07:13 | Re: Re-read conindid under the referenced table's lock in the RI fast path |
| Previous Message | Bertrand Drouvot | 2026-08-17 13:02:12 | Re: basebackup: do not verify checksums on pages written before enabling checksums |