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/
Andrew Chernow <ac@esilo.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
Tom Lane wrote: > Andrew Chernow <ac@esilo.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/
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера