clone varlena function - Mailing list pgsql-hackers

From Pavel Stehule
Subject clone varlena function
Date
Msg-id 162867790802021323h6a81ba4dn617c51c290751cbd@mail.gmail.com
Whole thread Raw
Responses Re: clone varlena function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: configurability of OOM killer
Next
From: Dimitri Fontaine
Date:
Subject: Re: configurability of OOM killer