Skip to main content
Version: 2.0.0 (latest)

3.32. Transforms

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 a need to do any special treatment of a data type in a procedural language environment, a transform object is ideal for this task.

ch3.transform-dialog.attributes123456

Attributes
#FieldGroup boxDescription
1TypeData type

The data type. Besides the built-in types, the list also holds the user-defined types, domains and other types of the model.

2DimensionData type

Number of dimensions when the type is an array (type[]). 0 means that the type is not an array.

3FormatData type

Read-only preview of the data type as it is written in the SQL code, with length, precision, dimension and other modifiers applied.

4Language

The language in which the transform operates.

5From SQL

The function that converts the type from the SQL environment to the language. It must take one argument of type internal and return internal.

6To SQL

The function that converts the type from the language to the SQL environment. It must take one argument of type internal and return the type of the transform.

References​

Transform DDL
https://www.postgresql.org/docs/current/static/sql-createtransform.html