GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.postgresql.org — CREATE TRANSFORM November 19, 2026: PostgreSQL 19 Released!
Development Versions:
devel
CREATE TRANSFORMCREATE TRANSFORM — define a new transform SynopsisCREATE [ OR REPLACE ] TRANSFORM FOR Description
A transform specifies how to adapt a data type to a procedural language. For example, when writing a function in PL/Python using the A transform specifies two functions:
It is not necessary to provide both of these functions. If one is not specified, the language-specific default behavior will be used if necessary. (To prevent a transformation in a certain direction from happening at all, you could also write a transform function that always errors out.) To be able to create a transform, you must own and have Parameters
NotesUse ExamplesTo create a transform for type CREATE TYPE hstore ...; CREATE EXTENSION plpython3u; Then create the necessary functions: CREATE FUNCTION hstore_to_plpython(val internal) RETURNS internal LANGUAGE C STRICT IMMUTABLE AS ...; CREATE FUNCTION plpython_to_hstore(val internal) RETURNS hstore LANGUAGE C STRICT IMMUTABLE AS ...; And finally create the transform to connect them all together: CREATE TRANSFORM FOR hstore LANGUAGE plpython3u (
FROM SQL WITH FUNCTION hstore_to_plpython(internal),
TO SQL WITH FUNCTION plpython_to_hstore(internal)
);
In practice, these commands would be wrapped up in an extension. The CompatibilityThis form of See AlsoCREATE FUNCTION, CREATE LANGUAGE, CREATE TYPE, DROP TRANSFORM Submit correctionIf you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |