Re: What happen to the VARATT_SIZEP macro in version 8.3?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What happen to the VARATT_SIZEP macro in version 8.3?
Дата
Msg-id 20542.1217978312@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: What happen to the VARATT_SIZEP macro in version 8.3?  (Glyn Astill <glynastill@yahoo.co.uk>)
Список pgsql-general
Glyn Astill <glynastill@yahoo.co.uk> writes:
>> What replaces the VARATT_SIZEP macro in version 8.3? I have spent a
>> long time checking the documentation and have not found the answer.

> SET_VARSIZE

Yes; you should always use VARSIZE() to fetch the length and
SET_VARSIZE() to set it.  If you need your code to still work
with pre-8.3 releases, you can make yourself a compatibility
macro like this:

#ifndef SET_VARSIZE
#define SET_VARSIZE(v,l) (VARATT_SIZEP(v) = (l))
#endif

Also note that detoasting might be needed in more places than
it was in 7.4; if you were cutting corners on a toastable type,
you'll have to check your code carefully.

See more advice here:
http://archives.postgresql.org/pgsql-general/2007-10/msg00604.php

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bytea encode performance issues
Следующее
От: "Vyacheslav Kalinin"
Дата:
Сообщение: Re: FTS on patterns