In most other database systems, stored procedures are only used with primitive datatypes such as integer, numeric, varchar, and so on. However, PostgreSQL is very different. You can basically use all datatypes available to you. This includes primitive as well as composite and custom types. There are simply no restrictions as far as datatypes are concerned. To unleash the full power of PostgreSQL, composite types are highly important and are often used by extensions which can be found on the internet.
The following example shows how a composite type can be passed to a function and how it can be used internally. Finally, the composite type will be returned again:
CREATE TYPE my_cool_type AS (s text, t text); CREATE ...