Update compatibility information.
This commit is contained in:
parent
a6496a2338
commit
861a0d7b5a
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.22 2001/09/13 15:55:24 petere Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.23 2001/09/13 19:05:29 petere Exp $
|
||||||
Postgres documentation
|
Postgres documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ CREATE
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>CREATE TYPE</command> allows the user to register a new user data
|
<command>CREATE TYPE</command> allows the user to register a new user data
|
||||||
type with Postgres for use in the current data base. The
|
type with PostgreSQL for use in the current data base. The
|
||||||
user who defines a type becomes its owner.
|
user who defines a type becomes its owner.
|
||||||
<replaceable class="parameter">typename</replaceable> is
|
<replaceable class="parameter">typename</replaceable> is
|
||||||
the name of the new type and must be unique within the
|
the name of the new type and must be unique within the
|
||||||
@ -235,9 +235,9 @@ CREATE
|
|||||||
New base data types can be fixed length, in which case
|
New base data types can be fixed length, in which case
|
||||||
<replaceable class="parameter">internallength</replaceable> is a
|
<replaceable class="parameter">internallength</replaceable> is a
|
||||||
positive integer, or variable length,
|
positive integer, or variable length,
|
||||||
in which case Postgres assumes that the new type has the
|
in which case PostgreSQL assumes that the new type has the
|
||||||
same format
|
same format
|
||||||
as the Postgres-supplied data type, <type>text</type>.
|
as the PostgreSQL-supplied data type, <type>text</type>.
|
||||||
To indicate that a type is variable length, set
|
To indicate that a type is variable length, set
|
||||||
<replaceable class="parameter">internallength</replaceable>
|
<replaceable class="parameter">internallength</replaceable>
|
||||||
to <option>VARIABLE</option>.
|
to <option>VARIABLE</option>.
|
||||||
@ -274,9 +274,9 @@ CREATE
|
|||||||
The optional arguments
|
The optional arguments
|
||||||
<replaceable class="parameter">send_function</replaceable> and
|
<replaceable class="parameter">send_function</replaceable> and
|
||||||
<replaceable class="parameter">receive_function</replaceable>
|
<replaceable class="parameter">receive_function</replaceable>
|
||||||
are used when the application program requesting Postgres
|
are used when the application program requesting PostgreSQL
|
||||||
services resides on a different machine. In this case,
|
services resides on a different machine. In this case,
|
||||||
the machine on which Postgres runs may use a format for the data
|
the machine on which PostgreSQL runs may use a format for the data
|
||||||
type different from that used on the remote machine.
|
type different from that used on the remote machine.
|
||||||
In this case it is appropriate to convert data items to a
|
In this case it is appropriate to convert data items to a
|
||||||
standard form when sending from the server to the client
|
standard form when sending from the server to the client
|
||||||
@ -327,91 +327,79 @@ CREATE
|
|||||||
Two generalized built-in functions, array_in and
|
Two generalized built-in functions, array_in and
|
||||||
array_out, exist for quick creation of variable-length
|
array_out, exist for quick creation of variable-length
|
||||||
array types. These functions operate on arrays of any
|
array types. These functions operate on arrays of any
|
||||||
existing Postgres type.
|
existing PostgreSQL type.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="SQL-CREATETYPE-notes">
|
||||||
|
<title>Notes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Type names cannot begin with the underscore character
|
||||||
|
(<quote><literal>_</literal></quote>) and can only be 31
|
||||||
|
characters long. This is because PostgreSQL silently creates an
|
||||||
|
array type for each base type with a name consisting of the base
|
||||||
|
type's name prepended with an underscore.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Examples</title>
|
<title>Examples</title>
|
||||||
<para>
|
<para>
|
||||||
This command creates the box data type and then uses the
|
This command creates the <type>box</type> data type and then uses the
|
||||||
type in a table definition:
|
type in a table definition:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TYPE box (INTERNALLENGTH = 8,
|
CREATE TYPE box (INTERNALLENGTH = 8,
|
||||||
INPUT = my_procedure_1, OUTPUT = my_procedure_2);
|
INPUT = my_procedure_1, OUTPUT = my_procedure_2);
|
||||||
CREATE TABLE myboxes (id INT4, description box);
|
CREATE TABLE myboxes (id INT4, description box);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This command creates a variable length array type with
|
This command creates a variable length array type with
|
||||||
integer elements:
|
<type>integer</type> elements:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out,
|
CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out,
|
||||||
INTERNALLENGTH = VARIABLE, ELEMENT = int4);
|
INTERNALLENGTH = VARIABLE, ELEMENT = int4);
|
||||||
CREATE TABLE myarrays (id int4, numbers int4array);
|
CREATE TABLE myarrays (id int4, numbers int4array);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This command creates a large object type and uses it in
|
This command creates a large object type and uses it in
|
||||||
a table definition:
|
a table definition:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout,
|
CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout,
|
||||||
INTERNALLENGTH = VARIABLE);
|
INTERNALLENGTH = VARIABLE);
|
||||||
CREATE TABLE big_objs (id int4, obj bigobj);
|
CREATE TABLE big_objs (id int4, obj bigobj);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATETYPE-3">
|
|
||||||
<refsect2info>
|
|
||||||
<date>1998-09-21</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Notes
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Type names cannot begin with the underscore character
|
|
||||||
("_") and can only be 31 characters long. This is because
|
|
||||||
Postgres silently creates an array type for each base type
|
|
||||||
with a name consisting of the base type's name prepended
|
|
||||||
with an underscore.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Refer to <command>DROP TYPE</command> to remove an existing type.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
See also <command>CREATE FUNCTION</command>,
|
|
||||||
<command>CREATE OPERATOR</command> and the chapter on Large Objects
|
|
||||||
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>.
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATETYPE-3">
|
|
||||||
<title>
|
|
||||||
Compatibility
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATETYPE-4">
|
<refsect1 id="SQL-CREATETYPE-compatibility">
|
||||||
<refsect2info>
|
<title>Compatibility</title>
|
||||||
<date>1998-09-21</date>
|
|
||||||
</refsect2info>
|
<para>
|
||||||
<title>
|
This <command>CREATE TYPE</command> command is a
|
||||||
SQL3
|
<productname>PostgreSQL</productname> extension. There is a
|
||||||
</title>
|
<command>CREATE TYPE</command> statement in SQL99 that is rather
|
||||||
<para>
|
different in detail.
|
||||||
<command>CREATE TYPE</command> is an <acronym>SQL3</acronym> statement.
|
</para>
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="SQL-CREATETYPE-see-also">
|
||||||
|
<title>See Also</title>
|
||||||
|
|
||||||
|
<simplelist type="inline">
|
||||||
|
<member><xref linkend="sql-createfunction"></member>
|
||||||
|
<member><xref linkend="sql-droptype"></member>
|
||||||
|
<member><citetitle>PostgreSQL Programmer's Guide</citetitle></member>
|
||||||
|
</simplelist>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_type.sgml,v 1.10 2001/09/03 12:57:50 petere Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_type.sgml,v 1.11 2001/09/13 19:05:29 petere Exp $
|
||||||
Postgres documentation
|
Postgres documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -95,64 +95,69 @@ ERROR: RemoveType: type '<replaceable class="parameter">typename</replaceable>'
|
|||||||
<para>
|
<para>
|
||||||
Only the owner of a type can remove it.
|
Only the owner of a type can remove it.
|
||||||
</para>
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-DROPTYPE-3">
|
<refsect1 id="SQL-DROPTYPE-notes">
|
||||||
<refsect2info>
|
<title>Notes</title>
|
||||||
<date>1998-09-22</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Notes
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
DROP TYPE statement is a <productname>Postgres</productname>
|
|
||||||
language extension.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Refer to <command>CREATE TYPE</command> for
|
|
||||||
information on how to create types.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
It is the user's responsibility to remove any operators,
|
|
||||||
functions, aggregates, access methods, subtypes, and tables
|
|
||||||
that use a deleted type.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<itemizedlist>
|
||||||
If a built-in type is removed, the behavior of the backend
|
<listitem>
|
||||||
is unpredictable.
|
<para>
|
||||||
</para>
|
It is the user's responsibility to remove any operators,
|
||||||
</refsect2>
|
functions, aggregates, access methods, subtypes, and tables that
|
||||||
|
use a deleted type.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If a built-in type is removed, the behavior of the server is
|
||||||
|
unpredictable.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-DROPTYPE-2">
|
<refsect1 id="SQL-DROPTYPE-examples">
|
||||||
<title>
|
<title>Examples</title>
|
||||||
Usage
|
|
||||||
</title>
|
|
||||||
<para>
|
<para>
|
||||||
To remove the <literal>box</literal> type:
|
To remove the <type>box</type> type:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DROP TYPE box;
|
DROP TYPE box;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-DROPTYPE-3">
|
<refsect1 id="SQL-DROPTYPE-compatibility">
|
||||||
<title>
|
<title>Compatibility</title>
|
||||||
Compatibility
|
|
||||||
</title>
|
<para>
|
||||||
|
A <command>DROP TYPE</command> statement exists in SQL99. As with
|
||||||
<refsect2 id="R2-SQL-DROPTYPE-5">
|
most other <quote>drop</quote> commands, <command>DROP
|
||||||
<refsect2info>
|
TYPE</command> in SQL99 requires a <quote>drop behavior</quote>
|
||||||
<date>1998-09-22</date>
|
clause to select between dropping all dependent objects or refusing
|
||||||
</refsect2info>
|
to drop if dependent objects exist:
|
||||||
<title>
|
<synopsis>
|
||||||
SQL3
|
DROP TYPE <replaceable>name</replaceable> { CASCADE | RESTRICT }
|
||||||
</title>
|
</synopsis>
|
||||||
<para>
|
<productname>PostgreSQL</productname> currently ignores
|
||||||
<command>DROP TYPE</command> is a <acronym>SQL3</acronym> statement.
|
dependencies altogether.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
|
||||||
|
<para>
|
||||||
|
Note that the <command>CREATE TYPE</command> command and the data
|
||||||
|
type extension mechanisms in <productname>PostgreSQL</productname>
|
||||||
|
differ from SQL99.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="SQL-DROPTYPE-see-also">
|
||||||
|
<title>See Also</title>
|
||||||
|
|
||||||
|
<simplelist type="inline">
|
||||||
|
<member><xref linkend="sql-createtype"></member>
|
||||||
|
</simplelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user