File: xfunc-internal.html

package info (click to toggle)
pgadmin3 1.4.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 29,796 kB
  • ctags: 10,758
  • sloc: cpp: 55,356; sh: 6,164; ansic: 1,520; makefile: 576; sql: 482; xml: 100; perl: 18
file content (49 lines) | stat: -rw-r--r-- 2,639 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>32.8.Internal Functions</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="extend.html" title="Chapter32.Extending SQL">
<link rel="prev" href="xfunc-pl.html" title="32.7.Procedural Language Functions">
<link rel="next" href="xfunc-c.html" title="32.9.C-Language Functions">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="xfunc-internal"></a>32.8.Internal Functions</h2></div></div></div>
<a name="id705996"></a><p>    Internal functions are functions written in C that have been statically
    linked into the <span class="productname">PostgreSQL</span> server.
    The &#8220;<span class="quote">body</span>&#8221; 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 backwards compatibility, an empty body
    is accepted as meaning that the C-language function name is the
    same as the SQL name.)
   </p>
<p>    Normally, all internal functions present in the
    server are declared during the initialization of the database cluster (<code class="command">initdb</code>),
    but a user could use <code class="command">CREATE FUNCTION</code>
    to create additional alias names for an internal function.
    Internal functions are declared in <code class="command">CREATE FUNCTION</code>
    with language name <code class="literal">internal</code>.  For instance, to
    create an alias for the <code class="function">sqrt</code> function:
</p>
<pre class="programlisting">CREATE FUNCTION square_root(double precision) RETURNS double precision
    AS 'dsqrt'
    LANGUAGE internal
    STRICT;</pre>
<p>
    (Most internal functions expect to be declared &#8220;<span class="quote">strict</span>&#8221;.)
   </p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>     Not all &#8220;<span class="quote">predefined</span>&#8221; functions are
     &#8220;<span class="quote">internal</span>&#8221; in the above sense.  Some predefined
     functions are written in SQL.
    </p>
</div>
</div></body>
</html>