Re: The PostgreSQL C Dialect

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: John Naylor <johncnaylorls(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: The PostgreSQL C Dialect
Date: 2026-06-23 13:53:08
Message-ID: 688312.1782222788@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christophe Pettus <xof(at)thebuild(dot)com> writes:
> On Jun 22, 2026, at 20:32, John Naylor <johncnaylorls(at)gmail(dot)com> wrote:
>> Size, Index - These are not common, and I think they are actually
>> discouraged now, in favor of the more common size_t and uint32. I'm
>> not sure if there's a consensus on that, though.

> Thanks! I'll be happy to edit if appropriate.

I think the consensus is to prefer "size_t" over "Size" in all-new
code. But when modifying or adding to existing code, match what's
around you, which in many places favors "Size".

"Index" is in a grayer area because there was never a solid consensus
on what to use it for to begin with. Again, there are places where
the match-nearby-code rule tells you to use Index, but if that doesn't
apply I'd avoid it.

BTW, you might want to mention match-nearby-code in the para about
naming too. It's not like we have just one preferred naming style
--- depending on where you look, there's camelCase, CapitalizeEachWord,
use_underscores_instead, etc etc. I have no appetite for trying to
force tree-wide uniformity on that score; but I do get annoyed when
adjacent routines don't look anything alike.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marcos Pegoraro 2026-06-23 14:03:08 Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Previous Message Benoit Lobréau 2026-06-23 13:47:34 Re: Logging parallel worker draught