]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/createlang.sgml
f0abeeae22a25823539666dc03633fab564f9478
[postgresql] / doc / src / sgml / ref / createlang.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.18 2001/10/22 23:48:11 tgl Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="APP-CREATELANG">
7  <docinfo>
8   <date>2001-05-09</date>
9  </docinfo>
10
11  <refmeta>
12   <refentrytitle id="APP-CREATELANG-TITLE"><application>createlang</application></refentrytitle>
13   <manvolnum>1</manvolnum>
14   <refmiscinfo>Application</refmiscinfo>
15  </refmeta>
16
17  <refnamediv>
18   <refname id="createlang">createlang</refname>
19   <refpurpose>define a new <productname>PostgreSQL</productname> procedural language</refpurpose>
20  </refnamediv>
21
22  <refsynopsisdiv>
23   <cmdsynopsis>
24    <command>createlang</command>
25    <arg rep="repeat"><replaceable>connection-options</replaceable></arg>
26    <arg><replaceable>langname</replaceable></arg>
27    <arg choice="plain"><replaceable>dbname</replaceable></arg>
28    <sbr>
29    <command>createlang</command>
30    <arg rep="repeat"><replaceable>connection-options</replaceable></arg>
31    <group choice="plain"><arg>--list</arg><arg>-l</arg></group>
32    <arg choice="plain"><replaceable>dbname</replaceable></arg>
33   </cmdsynopsis>
34
35   <refsect2 id="R2-APP-CREATELANG-1">
36    <title>
37     Inputs
38    </title>
39    <para>
40     <application>createlang</application> accepts the following command line arguments:
41     
42     <variablelist>
43      <varlistentry>
44       <term><replaceable class="parameter">langname</replaceable></term>
45       <listitem>
46        <para>
47         Specifies the name of the backend programming language to be defined.
48         <application>createlang</application> will prompt for
49         <replaceable class="parameter">langname</replaceable>
50         if it is not specified on the command line.
51        </para>
52       </listitem>
53      </varlistentry>
54
55      <varlistentry>
56       <term>-d, --dbname <replaceable class="parameter">dbname</replaceable></term>
57       <listitem>
58        <para>
59         Specifies which database the language should be added.
60        </para>
61       </listitem>
62      </varlistentry>
63
64      <varlistentry>
65       <term>-e, --echo</term>
66       <listitem>
67        <para>
68         Displays SQL commands as they are executed.
69        </para>
70       </listitem>
71      </varlistentry>
72
73      <varlistentry>
74       <term>-l, --list</term>
75       <listitem>
76        <para>
77         Shows a list of already installed languages in the target database
78         (which must be specified).
79        </para>
80       </listitem>
81      </varlistentry>
82
83      <varlistentry>
84       <term>--L <replaceable class="parameter">directory</replaceable></term>
85       <listitem>
86        <para>
87         Specifies the directory in which the language interpreter is
88         to be found.  This is normally found automatically.
89        </para>
90       </listitem>
91      </varlistentry>
92
93     </variablelist>
94    </para>
95
96    <para>
97     <application>createlang</application> also accepts 
98     the following command line arguments for connection parameters:
99     
100     <variablelist>
101      <varlistentry>
102       <term>-h, --host <replaceable class="parameter">host</replaceable></term>
103       <listitem>
104        <para>
105         Specifies the hostname of the machine on which the 
106         <application>postmaster</application>
107         is running.  If host begins with a slash, it is used 
108         as the directory for the unix domain socket.
109        </para>
110       </listitem>
111      </varlistentry>
112
113      <varlistentry>
114       <term>-p, --port <replaceable class="parameter">port</replaceable></term>
115       <listitem>
116        <para>
117         Specifies the Internet TCP/IP port or local Unix domain socket file 
118         extension on which the <application>postmaster</application>
119         is listening for connections.
120        </para>
121       </listitem>
122      </varlistentry>
123
124      <varlistentry>
125       <term>-U, --username <replaceable class="parameter">username</replaceable></term>
126       <listitem>
127        <para>
128         Username to connect as.
129        </para>
130       </listitem>
131      </varlistentry>
132
133      <varlistentry>
134       <term>-W, --password</term>
135       <listitem>
136        <para>
137         Force password prompt.
138        </para>
139       </listitem>
140      </varlistentry>
141
142     </variablelist>
143    </para>
144   </refsect2>
145
146   <refsect2 id="R2-APP-CREATELANG-2">
147    <title>
148     Outputs
149    </title>
150    <para>
151     Most error messages are self-explanatory. If not, run
152     <application>createlang</application> with the <option>--echo</option>
153     option and see under the respective <acronym>SQL</acronym> command
154     for details. Check also under <xref linkend="APP-PSQL">
155     for more possibilities.
156    </para>
157   </refsect2>
158  </refsynopsisdiv>
159  
160  <refsect1 id="R1-APP-CREATELANG-1">
161   <title>
162    Description
163   </title>
164
165   <para>
166    <application>createlang</application> is a utility for adding a new 
167    programming language to a <productname>Postgres</productname> database.
168    <application>createlang</application> currently accepts several
169    languages, <literal>plpgsql, pltcl, pltclu,</literal> and <literal>
170    plperl</literal>.
171   </para>
172   <para>
173    Although backend programming languages can be added directly using
174    several <acronym>SQL</acronym> commands, it is recommended to use
175    <application>createlang</application> because it performs a number
176    of checks and is much easier to use. See
177    <xref linkend="sql-createlanguage" endterm="sql-createlanguage-title">
178    for more.
179   </para>
180  </refsect1>
181
182  <refsect1 id="R1-APP-CREATELANG-2">
183   <title>
184    Notes
185   </title>
186   <para>
187    Use <xref linkend="app-droplang"> to remove a language.
188   </para>
189
190   <para>
191    <application>createlang</application> is a shell script that invokes
192    <application>psql</application> several times.  If you have things
193    arranged so that a password prompt is required to connect, you will be
194    prompted for a password several times.
195   </para>
196  </refsect1>
197  
198  <refsect1 id="R1-APP-CREATELANG-3">
199   <title>Usage</title>
200
201   <informalexample>
202    <para>
203     To install <literal>pltcl</literal> into the database
204     <literal>template1</literal>:
205 <screen>
206 <prompt>$ </prompt><userinput>createlang pltcl template1</userinput>
207 </screen>
208    </para>
209   </informalexample>
210  </refsect1>
211 </refentry>
212
213 <!-- Keep this comment at the end of the file
214 Local variables:
215 mode: sgml
216 sgml-omittag:nil
217 sgml-shorttag:t
218 sgml-minimize-attributes:nil
219 sgml-always-quote-attributes:t
220 sgml-indent-step:1
221 sgml-indent-data:t
222 sgml-parent-document:nil
223 sgml-default-dtd-file:"../reference.ced"
224 sgml-exposed-tags:nil
225 sgml-local-catalogs:"/usr/lib/sgml/catalog"
226 sgml-local-ecat-files:nil
227 End:
228 -->