clone varlena function

Поиск
Список
Период
Сортировка
Искать

clone varlena function

От:
"Pavel Stehule" <pavel.stehule@gmail.com>
Дата:
Hello,

I am cleaning orafce module and I would to eliminate duplicit code
with core. Is in core similar macro or function?

text*
ora_clone_text(text *t)
{       text *result;
       result = palloc(VARSIZE(t));       SET_VARSIZE(result, VARSIZE(t));       memcpy(VARDATA(result), VARDATA(t), VARSIZE(t) - VARHDRSZ);
       return result;
}

It can be used for any varlena datatype.

Thank you
Pavel Stehule

Re: clone varlena function

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Pavel Stehule"  writes:
> I am cleaning orafce module and I would to eliminate duplicit code
> with core. Is in core similar macro or function?

datumCopy?
		regards, tom lane

Re: clone varlena function

От:
"Pavel Stehule" <pavel.stehule@gmail.com>
Дата:
On 02/02/2008, Tom Lane  wrote:
> "Pavel Stehule"  writes:
> > I am cleaning orafce module and I would to eliminate duplicit code
> > with core. Is in core similar macro or function?
>
> datumCopy?
>

yes, it is it.

thank you

Pavel Stehule

>                         regards, tom lane
>

FAQ