]> begriffs open source - ai-pg/blob - full-docs/txt/xfunc-internal.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / xfunc-internal.txt
1
2 36.9. Internal Functions #
3
4    Internal functions are functions written in C that have been statically
5    linked into the PostgreSQL server. The “body” of the function
6    definition specifies the C-language name of the function, which need
7    not be the same as the name being declared for SQL use. (For reasons of
8    backward compatibility, an empty body is accepted as meaning that the
9    C-language function name is the same as the SQL name.)
10
11    Normally, all internal functions present in the server are declared
12    during the initialization of the database cluster (see Section 18.2),
13    but a user could use CREATE FUNCTION to create additional alias names
14    for an internal function. Internal functions are declared in CREATE
15    FUNCTION with language name internal. For instance, to create an alias
16    for the sqrt function:
17 CREATE FUNCTION square_root(double precision) RETURNS double precision
18     AS 'dsqrt'
19     LANGUAGE internal
20     STRICT;
21
22    (Most internal functions expect to be declared “strict”.)
23
24 Note
25
26    Not all “predefined” functions are “internal” in the above sense. Some
27    predefined functions are written in SQL.