pstrdup(TextDatumGetCString(foo)) ?

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема pstrdup(TextDatumGetCString(foo)) ?
Дата
Msg-id 56E0EE02.1040808@anastigmatix.net
обсуждение исходный текст
Ответы Re: pstrdup(TextDatumGetCString(foo)) ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I am encountering, here and there, an idiom like
 pstrdup(TextDatumGetCString(foo))

or a pre-8.4 version,
 pstrdup(DatumGetCString(DirectFunctionCall1(textout, foo)))

It's leading me to question my sanity because it appears to me
that both text_to_cstring (underlying TextDatumGetCString) and
textout already return a string palloc'd in the current context,
and that pstrdup (without any change of context) can't be accomplishing
anything. I'm probably missing something crucial, but what?

-Chap



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pg_rewind just doesn't fsync *anything*?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pstrdup(TextDatumGetCString(foo)) ?