11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.22 2001/09/1315:55:24 petere Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.23 2001/09/1319:05:29 petere Exp $
33Postgres documentation
44-->
55
@@ -210,7 +210,7 @@ CREATE
210210
211211 <para>
212212 <command>CREATE TYPE</command> allows the user to register a new user data
213- type withPostgres for use in the current data base. The
213+ type withPostgreSQL for use in the current data base. The
214214 user who defines a type becomes its owner.
215215 <replaceable class="parameter">typename</replaceable> is
216216 the name of the new type and must be unique within the
@@ -235,9 +235,9 @@ CREATE
235235 New base data types can be fixed length, in which case
236236 <replaceable class="parameter">internallength</replaceable> is a
237237 positive integer, or variable length,
238- in which casePostgres assumes that the new type has the
238+ in which casePostgreSQL assumes that the new type has the
239239 same format
240- as thePostgres -supplied data type, <type>text</type>.
240+ as thePostgreSQL -supplied data type, <type>text</type>.
241241 To indicate that a type is variable length, set
242242 <replaceable class="parameter">internallength</replaceable>
243243 to <option>VARIABLE</option>.
@@ -274,9 +274,9 @@ CREATE
274274 The optional arguments
275275 <replaceable class="parameter">send_function</replaceable> and
276276 <replaceable class="parameter">receive_function</replaceable>
277- are used when the application program requestingPostgres
277+ are used when the application program requestingPostgreSQL
278278 services resides on a different machine. In this case,
279- the machine on whichPostgres runs may use a format for the data
279+ the machine on whichPostgreSQL runs may use a format for the data
280280 type different from that used on the remote machine.
281281 In this case it is appropriate to convert data items to a
282282 standard form when sending from the server to the client
@@ -327,91 +327,79 @@ CREATE
327327 Two generalized built-in functions, array_in and
328328 array_out, exist for quick creation of variable-length
329329 array types. These functions operate on arrays of any
330- existingPostgres type.
330+ existingPostgreSQL type.
331331 </para>
332332 </refsect2>
333-
334333 </refsect1>
335334
335+ <refsect1 id="SQL-CREATETYPE-notes">
336+ <title>Notes</title>
337+
338+ <para>
339+ Type names cannot begin with the underscore character
340+ (<quote><literal>_</literal></quote>) and can only be 31
341+ characters long. This is because PostgreSQL silently creates an
342+ array type for each base type with a name consisting of the base
343+ type's name prepended with an underscore.
344+ </para>
345+ </refsect1>
346+
336347 <refsect1>
337348 <title>Examples</title>
338349 <para>
339- This command creates the box data type and then uses the
350+ This command creates the<type> box</type> data type and then uses the
340351 type in a table definition:
341- <programlisting>
352+ <programlisting>
342353CREATE TYPE box (INTERNALLENGTH = 8,
343354 INPUT = my_procedure_1, OUTPUT = my_procedure_2);
344355CREATE TABLE myboxes (id INT4, description box);
345- </programlisting>
356+ </programlisting>
346357 </para>
347358
348359 <para>
349360 This command creates a variable length array type with
350- integer elements:
361+ <type> integer</type> elements:
351362
352- <programlisting>
363+ <programlisting>
353364CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out,
354365 INTERNALLENGTH = VARIABLE, ELEMENT = int4);
355366CREATE TABLE myarrays (id int4, numbers int4array);
356- </programlisting>
367+ </programlisting>
357368 </para>
358369
359370 <para>
360371 This command creates a large object type and uses it in
361372 a table definition:
362373
363- <programlisting>
374+ <programlisting>
364375CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout,
365376 INTERNALLENGTH = VARIABLE);
366377CREATE TABLE big_objs (id int4, obj bigobj);
367- </programlisting>
378+ </programlisting>
368379 </para>
380+ </refsect1>
369381
370- <refsect2 id="R2-SQL-CREATETYPE-3">
371- <refsect2info>
372- <date>1998-09-21</date>
373- </refsect2info>
374- <title>
375- Notes
376- </title>
377-
378- <para>
379- Type names cannot begin with the underscore character
380- ("_") and can only be 31 characters long. This is because
381- Postgres silently creates an array type for each base type
382- with a name consisting of the base type's name prepended
383- with an underscore.
384- </para>
382+ <refsect1 id="SQL-CREATETYPE-compatibility">
383+ <title>Compatibility</title>
385384
386- <para>
387- Refer to <command>DROP TYPE</command> to remove an existing type.
388- </para>
389- <para>
390- See also <command>CREATE FUNCTION</command>,
391- <command>CREATE OPERATOR</command> and the chapter on Large Objects
392- in the <citetitle>PostgreSQL Programmer's Guide</citetitle>.
393- </para>
394- </refsect2>
385+ <para>
386+ This <command>CREATE TYPE</command> command is a
387+ <productname>PostgreSQL</productname> extension. There is a
388+ <command>CREATE TYPE</command> statement in SQL99 that is rather
389+ different in detail.
390+ </para>
395391 </refsect1>
396-
397-
398- <refsect1 id="R1-SQL-CREATETYPE-3">
399- <title>
400- Compatibility
401- </title>
402392
403- <refsect2 id="R2-SQL-CREATETYPE-4">
404- <refsect2info>
405- <date>1998-09-21</date>
406- </refsect2info>
407- <title>
408- SQL3
409- </title>
410- <para>
411- <command>CREATE TYPE</command> is an <acronym>SQL3</acronym> statement.
412- </para>
413- </refsect2>
393+ <refsect1 id="SQL-CREATETYPE-see-also">
394+ <title>See Also</title>
395+
396+ <simplelist type="inline">
397+ <member><xref linkend="sql-createfunction"></member>
398+ <member><xref linkend="sql-droptype"></member>
399+ <member><citetitle>PostgreSQL Programmer's Guide</citetitle></member>
400+ </simplelist>
414401 </refsect1>
402+
415403</refentry>
416404
417405