Lists: | pgsql-hackers |
---|
From: | Andrew Chernow <ac(at)esilo(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | VARSIZE - why omit VARLEN? |
Date: | 2009-01-18 02:27:18 |
Message-ID: | 49729386.9050207@esilo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Any objections adding the below to postgres.h?
#define VARLEN(PTR) (VARSIZE(PTR) - VARHDRSZ)
It adds a little more abstraction and cleans up userland code.
--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andrew Chernow <ac(at)esilo(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: VARSIZE - why omit VARLEN? |
Date: | 2009-01-18 06:08:52 |
Message-ID: | 23652.1232258932@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Andrew Chernow <ac(at)esilo(dot)com> writes:
> Any objections adding the below to postgres.h?
> #define VARLEN(PTR) (VARSIZE(PTR) - VARHDRSZ)
For the most part, you should probably be using VARSIZE_ANY_EXHDR
anyplace that that might be a good idea.
regards, tom lane
From: | Andrew Chernow <ac(at)esilo(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: VARSIZE - why omit VARLEN? |
Date: | 2009-01-18 14:18:29 |
Message-ID: | 49733A35.8060101@esilo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Andrew Chernow <ac(at)esilo(dot)com> writes:
>> Any objections adding the below to postgres.h?
>> #define VARLEN(PTR) (VARSIZE(PTR) - VARHDRSZ)
>
> For the most part, you should probably be using VARSIZE_ANY_EXHDR
> anyplace that that might be a good idea.
>
> regards, tom lane
>
>
Thanks, that will do it. I didn't know that macro existed. I missed its
addition in 8.3. sorry.
--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/