PostgreSQL

PostgreSQL Elephant Logo

38.9. Internal Functions #

Internal functions are functions written in C that have been statically linked into the PostgreSQL server. The “[.quote]#body”# of the function definition specifies the C-language name of the function, which need not be the same as the name being declared for SQL use. (For reasons of backward compatibility, an empty body is accepted as meaning that the C-language function name is the same as the SQL name.)

Normally, all internal functions present in the server are declared during the initialization of the database cluster (see Section 19.2), but a user could use CREATE FUNCTION to create additional alias names for an internal function. Internal functions are declared in CREATE FUNCTION with language name internal. For instance, to create an alias for the sqrt function:

CREATE FUNCTION square_root(double precision) RETURNS double precision
    AS 'dsqrt'
    LANGUAGE internal
    STRICT;

(Most internal functions expect to be declared “[.quote]#strict”#.)

Note

Not all “[.quote]#predefined”# functions are “[.quote]#internal”# in the above sense. Some predefined functions are written in SQL.


Prev Up Next

38.8. Procedural Language Functions

Home

38.10. C-Language Functions

Submit correction

If 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.

Copyright © 1996-2024 The PostgreSQL Global Development Group