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.




Reply via email to