RefLib

Reference library for AI

Back

postgresql_16:7.1.65.7 Compatibility

PostgreSQL 16 > Reference > SQL Commands > CREATE FUNCTION > Compatibility

A CREATE FUNCTION command is defined in the SQL standard. The PostgreSQL implementation can be used in a compatible way but has many extensions. Conversely, the SQL standard specifies a number of optional features that are not implemented in PostgreSQL.

The following are important compatibility issues: OR REPLACE is a PostgreSQL extension. For compatibility with some other database systems, *argmode* can be written either before or after *argname*. But only the first way is standard-compliant. For parameter defaults, the SQL standard specifies only the syntax with the DEFAULT key word. The syntax with = is used in T-SQL and Firebird. The SETOF modifier is a PostgreSQL extension. Only SQL is standardized as a language. All other attributes except CALLED ON NULL INPUT and RETURNS NULL ON NULL INPUT are not standardized. For the body of LANGUAGE SQL functions, the SQL standard only specifies the *sql_body* form.

Simple LANGUAGE SQL functions can be written in a way that is both standard-conforming and portable to other implementations. More complex functions using advanced features, optimization attributes, or other languages will necessarily be specific to PostgreSQL in a significant way.

Back