A transform, as stated by the PostgreSQL docs, specifies how to adapt a data type to a procedural language. For example, when writing a function in PL/Python using the hstore
type, PL/Python has no prior knowledge of how to present hstore
values in the Python environment. Language implementations usually default to using text representation. If there's the need to do any special treatment of a data type in a procedural language environment, a transform object is ideal for this task.
Attribute | Description |
---|---|
Language |
The language in which the transform must operate over. |
Data Type |
The name of the data type that the transform will operate over. |
From SQL |
The name of the function for converting the type from the SQL environment to the language. It must take one argument of type internal and return type internal . |
To SQL |
The name of the function for converting the type from the language to the SQL environment. It must take one argument of type internal and return the type that is the type for the transform. |