Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] Use idiomatic style for varlena structs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jay Levitt <jay(dot)levitt(at)gmail(dot)com>
Cc: "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: [PATCH] Use idiomatic style for varlena structs
Date: 2012-02-13 15:51:51
Message-ID: 10780.1329148311@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-docs
Jay Levitt <jay(dot)levitt(at)gmail(dot)com> 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

In response to

Responses

pgsql-docs by date

Next:From: Jay LevittDate: 2012-02-13 18:57:30
Subject: Re: [PATCH] Use idiomatic style for varlena structs
Previous:From: Jay LevittDate: 2012-02-13 14:45:23
Subject: [PATCH] Use idiomatic style for varlena structs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group