Class: PG::TextEncoder::Bytea
- Inherits:
-
SimpleEncoder
- Object
- Coder
- SimpleCoder
- SimpleEncoder
- PG::TextEncoder::Bytea
- Defined in:
- ext/pg_text_encoder.c
Overview
This is an encoder class for the PostgreSQL bytea
type.
The binary String is converted to hexadecimal representation for transmission in text format. For query bind parameters it is recommended to use PG::BinaryEncoder::Bytea or the hash form {value: binary_string, format: 1}
instead, in order to decrease network traffic and CPU usage. See PG::Connection#exec_params for using the hash form.
This encoder is particular useful when PG::TextEncoder::CopyRow is used with the COPY command. In this case there’s no way to change the format of a single column to binary, so that the data have to be converted to bytea hex representation.
Constant Summary
Constants inherited from Coder
Coder::FORMAT_ERROR_MASK, Coder::FORMAT_ERROR_TO_PARTIAL, Coder::FORMAT_ERROR_TO_RAISE, Coder::FORMAT_ERROR_TO_STRING, Coder::TIMESTAMP_APP_LOCAL, Coder::TIMESTAMP_APP_UTC, Coder::TIMESTAMP_DB_LOCAL, Coder::TIMESTAMP_DB_UTC
Instance Attribute Summary
Attributes inherited from Coder
Method Summary
Methods inherited from Coder
#==, #dup, #flags, #flags=, #format, #format=, #initialize, #inspect, #inspect_short, #marshal_dump, #marshal_load, #oid, #oid=, #to_h
Constructor Details
This class inherits a constructor from PG::Coder