[PATCH] Clarify the comments about varlena header encoding

2022-08-17 Thread Aleksander Alekseev
Hi hackers, I noticed that the comments regarding bit layouts for varlena headers in postgres.h are somewhat misleading. For instance, when reading: ``` 00xx 4-byte length word, aligned, uncompressed data (up to 1G) ``` ... one can assume this is a 00xx byte followed by another 4 bytes (

Re: [PATCH] Clarify the comments about varlena header encoding

2022-10-11 Thread Michael Paquier
On Mon, Sep 12, 2022 at 11:47:07AM +0700, John Naylor wrote: > I don't think this clarifies anything, it's just a rephrasing. > > More broadly, I think the description of varlenas in this header is at > a kind of "local maximum" -- minor adjustments are more likely to make > it worse. To significa

Re: [PATCH] Clarify the comments about varlena header encoding

2022-08-17 Thread John Naylor
On Thu, Aug 18, 2022 at 1:06 AM Aleksander Alekseev wrote: > > Hi hackers, > > I noticed that the comments regarding bit layouts for varlena headers > in postgres.h are somewhat misleading. For instance, when reading: I agree it's confusing, but I don't think this patch is the right direction. >

Re: [PATCH] Clarify the comments about varlena header encoding

2022-09-06 Thread Aleksander Alekseev
Hi John, Thanks for the feedback. > Maybe "00xx 4-byte length word (aligned)," is more clear about > what is aligned. Also, adding all those xxx's obscures the point that > we only need to examine one byte to figure out what to do next. IMO "00xx 4-byte length word" is still confusing. O

Re: [PATCH] Clarify the comments about varlena header encoding

2022-09-07 Thread John Naylor
On Tue, Sep 6, 2022 at 5:19 PM Aleksander Alekseev wrote: > > Hi John, > > Thanks for the feedback. > > > Maybe "00xx 4-byte length word (aligned)," is more clear about > > what is aligned. Also, adding all those xxx's obscures the point that > > we only need to examine one byte to figure out

Re: [PATCH] Clarify the comments about varlena header encoding

2022-09-11 Thread Aleksander Alekseev
Hi John, Many thanks for the feedback! > Or put the now-standard 0b in front. Good idea. > I think the problem is ambiguity about what a "toast pointer" is. This > comment: > > * struct varatt_external is a traditional "TOAST pointer", that is, the Right. The comment for varatt_external says

Re: [PATCH] Clarify the comments about varlena header encoding

2022-09-11 Thread John Naylor
On Sun, Sep 11, 2022 at 5:06 PM Aleksander Alekseev wrote: > > Hi John, > > Many thanks for the feedback! > > > Or put the now-standard 0b in front. > > Good idea. Now that I look at the results, though, it's distracting and not good for readability. I'm not actually sure we need to do anything h