Skip to content

Commit 861a0d7

Browse files
committed
Update compatibility information.
1 parent a6496a2 commit 861a0d7

File tree

2 files changed

+99
-106
lines changed

2 files changed

+99
-106
lines changed

doc/src/sgml/ref/create_type.sgml

Lines changed: 45 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.22 2001/09/13 15:55:24 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.23 2001/09/13 19:05:29 petere Exp $
33
Postgres 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 with Postgres for use in the current data base. The
213+
type with PostgreSQL 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 case Postgres assumes that the new type has the
238+
in which case PostgreSQL assumes that the new type has the
239239
same format
240-
as the Postgres-supplied data type, <type>text</type>.
240+
as the PostgreSQL-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 requesting Postgres
277+
are used when the application program requesting PostgreSQL
278278
services resides on a different machine. In this case,
279-
the machine on which Postgres runs may use a format for the data
279+
the machine on which PostgreSQL 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-
existing Postgres type.
330+
existing PostgreSQL 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>
342353
CREATE TYPE box (INTERNALLENGTH = 8,
343354
INPUT = my_procedure_1, OUTPUT = my_procedure_2);
344355
CREATE 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>
353364
CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out,
354365
INTERNALLENGTH = VARIABLE, ELEMENT = int4);
355366
CREATE 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>
364375
CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout,
365376
INTERNALLENGTH = VARIABLE);
366377
CREATE 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

doc/src/sgml/ref/drop_type.sgml

Lines changed: 54 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_type.sgml,v 1.10 2001/09/03 12:57:50 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_type.sgml,v 1.11 2001/09/13 19:05:29 petere Exp $
33
Postgres documentation
44
-->
55

@@ -95,64 +95,69 @@ ERROR: RemoveType: type '<replaceable class="parameter">typename</replaceable>'
9595
<para>
9696
Only the owner of a type can remove it.
9797
</para>
98+
</refsect1>
9899

99-
<refsect2 id="R2-SQL-DROPTYPE-3">
100-
<refsect2info>
101-
<date>1998-09-22</date>
102-
</refsect2info>
103-
<title>
104-
Notes
105-
</title>
106-
<para>
107-
DROP TYPE statement is a <productname>Postgres</productname>
108-
language extension.
109-
</para>
110-
<para>
111-
Refer to <command>CREATE TYPE</command> for
112-
information on how to create types.
113-
</para>
114-
<para>
115-
It is the user's responsibility to remove any operators,
116-
functions, aggregates, access methods, subtypes, and tables
117-
that use a deleted type.
118-
</para>
100+
<refsect1 id="SQL-DROPTYPE-notes">
101+
<title>Notes</title>
119102

120-
<para>
121-
If a built-in type is removed, the behavior of the backend
122-
is unpredictable.
123-
</para>
124-
</refsect2>
103+
<itemizedlist>
104+
<listitem>
105+
<para>
106+
It is the user's responsibility to remove any operators,
107+
functions, aggregates, access methods, subtypes, and tables that
108+
use a deleted type.
109+
</para>
110+
</listitem>
111+
112+
<listitem>
113+
<para>
114+
If a built-in type is removed, the behavior of the server is
115+
unpredictable.
116+
</para>
117+
</listitem>
118+
</itemizedlist>
125119
</refsect1>
126120

127-
<refsect1 id="R1-SQL-DROPTYPE-2">
128-
<title>
129-
Usage
130-
</title>
121+
<refsect1 id="SQL-DROPTYPE-examples">
122+
<title>Examples</title>
131123
<para>
132-
To remove the <literal>box</literal> type:
124+
To remove the <type>box</type> type:
133125

134-
<programlisting>
126+
<programlisting>
135127
DROP TYPE box;
136-
</programlisting>
128+
</programlisting>
137129
</para>
138130
</refsect1>
139131

140-
<refsect1 id="R1-SQL-DROPTYPE-3">
141-
<title>
142-
Compatibility
143-
</title>
144-
145-
<refsect2 id="R2-SQL-DROPTYPE-5">
146-
<refsect2info>
147-
<date>1998-09-22</date>
148-
</refsect2info>
149-
<title>
150-
SQL3
151-
</title>
152-
<para>
153-
<command>DROP TYPE</command> is a <acronym>SQL3</acronym> statement.
154-
</para>
155-
</refsect2>
132+
<refsect1 id="SQL-DROPTYPE-compatibility">
133+
<title>Compatibility</title>
134+
135+
<para>
136+
A <command>DROP TYPE</command> statement exists in SQL99. As with
137+
most other <quote>drop</quote> commands, <command>DROP
138+
TYPE</command> in SQL99 requires a <quote>drop behavior</quote>
139+
clause to select between dropping all dependent objects or refusing
140+
to drop if dependent objects exist:
141+
<synopsis>
142+
DROP TYPE <replaceable>name</replaceable> { CASCADE | RESTRICT }
143+
</synopsis>
144+
<productname>PostgreSQL</productname> currently ignores
145+
dependencies altogether.
146+
</para>
147+
148+
<para>
149+
Note that the <command>CREATE TYPE</command> command and the data
150+
type extension mechanisms in <productname>PostgreSQL</productname>
151+
differ from SQL99.
152+
</para>
153+
</refsect1>
154+
155+
<refsect1 id="SQL-DROPTYPE-see-also">
156+
<title>See Also</title>
157+
158+
<simplelist type="inline">
159+
<member><xref linkend="sql-createtype"></member>
160+
</simplelist>
156161
</refsect1>
157162
</refentry>
158163

0 commit comments

Comments
 (0)