Search Postgresql Archives

Re: carray_to_bytea?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/22/15 12:13 PM, Ken Been wrote:
My input is a byte array with a length.
I can't assume zero-termination for varchar fields, so
cstring_to_text_with_len
is exactly what I need for those. For varbinary (i.e., bytea), you're
right, it's
just a couple of lines of code, but what if the implementation of struct
varlena
changes?  Are we guaranteed that "palloc(len + VARHDRSZ)" will always
allocate the correct amount?

Why not just (bytea) cstring_to_text_with_len(...) ?
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux