All Products
Search
Document Center

PolarDB:ST_SetBinData

Last Updated:Mar 28, 2026

Attaches user-defined binary data to an sfmesh or material object and returns the modified object.

Syntax

sfmesh ST_SetBinData(sfmesh sfmeshObject, bytea data);
material ST_SetBinData(material material, bytea data);

Parameters

ParameterDescription
sfmeshObjectThe sfmesh object to attach data to.
materialThe material object to attach data to.
dataThe user-defined binary data to store, as a bytea value.

Return value

Returns the modified object — sfmesh or material — with the binary data attached.

Description

ST_SetBinData stores arbitrary user-defined data on an sfmesh or material object in binary representation. Storing data as bytea preserves the exact byte sequence without text encoding overhead or precision loss, which makes it suitable for embedding custom metadata or application-specific payloads directly on the object.

ST_SetBinData is the setter counterpart to ST_BinData. Call ST_BinData to retrieve the binary data you set with ST_SetBinData.

Examples

Set binary data on an sfmesh object

SELECT ST_BinData(ST_SetBinData(the_mesh, 'abc'::bytea))
FROM t_table;

Output:

-------------------
\x616263

\x616263 is the hex representation of the string abc in bytea format.

See also

  • ST_BinData: Read the binary data attached to an sfmesh or material object.