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
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead. 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 DROP TRANSFORM to remove transforms. ExamplesTo create a transform for type CREATE TYPE hstore ...; CREATE EXTENSION plpythonu; 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 plpythonu (
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 |
| 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. |