Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 8D96D1FC9B63 for ; Mon, 13 Feb 2012 11:52:07 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RwyCD-0007Mx-8g for pgsql-docs@postgresql.org; Mon, 13 Feb 2012 15:52:06 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q1DFppsi010781; Mon, 13 Feb 2012 10:51:51 -0500 (EST) To: Jay Levitt cc: "pgsql-docs@postgresql.org" Subject: Re: [PATCH] Use idiomatic style for varlena structs In-reply-to: <4F392203.2040907@gmail.com> References: <4F392203.2040907@gmail.com> Comments: In-reply-to Jay Levitt message dated "Mon, 13 Feb 2012 09:45:23 -0500" Date: Mon, 13 Feb 2012 10:51:51 -0500 Message-ID: <10780.1329148311@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/7 X-Sequence-Number: 7191 Jay Levitt writes: > I'm new to the codebase, but I think this patch reflects real-world usage; > the PostgreSQL code itself always calls the length field "vl_len_", and I > believe int32 is preferred over int4 (yes?) The point of calling it vl_len_ is that it should never be referenced by that name, so I'm not sure that propagating that name into user documentation is a good idea. I do agree with the part of this patch that recommends use of SET_VARSIZE. For context, the issues you're concerned about only matter when dealing with a toastable datatype (not all varlena types are toastable). The particular bit of docs here doesn't pretend to be explaining how to write toast-safe code. I think it might be better from an expository standpoint to cover that separately, rather than try to work it into the very first pass over the concepts. regards, tom lane