Simplifying unknown-literal handling

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Simplifying unknown-literal handling
Дата
Msg-id 4146.1117381638@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Simplifying unknown-literal handling  (Alvaro Herrera <alvherre@surnet.cl>)
Список pgsql-hackers
For the past couple of releases we've had support for cstring
(null-terminated string) as a full fledged datatype: you set
typlen = -2 to indicate that strlen() must be used to calculate
the actual size of a Datum.

It occurs to me that we should change type UNKNOWN's internal
representation to be like cstring rather than like text.  The
advantage of this is that the places in the parser that currently
call unknownin and unknownout could be replaced by just
CStringGetDatum and DatumGetCString, respectively, thus saving
two palloc's and two memcpy's per string literal.  It's not much,
but considering that this happens every time we parse a string
literal, I think it'll add up to a savings worth the small amount
of effort needed.

Anyone see a reason not to change this?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: compiling postgres with Visual Age compiler on OpenPower5 / Linux
Следующее
От: Tom Lane
Дата:
Сообщение: Small change in LockAcquire API