• Bruce Momjian's avatar
    Ok. Updated patch attached. · 01c76f74
    Bruce Momjian authored
    - domain.patch -> source patch against pgsql in cvs
    - drop_domain.sgml and create_domain.sgml -> New doc/src/sgml/ref docs
    
    - dominfo.txt -> basic domain related queries I used for testing
    [ ADDED TO /doc]
    
    Enables domains of array elements -> CREATE DOMAIN dom int4[3][2];
    
    Uses a typbasetype column to describe the origin of the domain.
    
    Copies data to attnotnull rather than processing in execMain().
    
    Some documentation differences from earlier.
    
    If this is approved, I'll start working on pg_dump, and a \dD <domain>
    option in psql, and regression tests.  I don't really feel like doing
    those until the system table structure settles for pg_type.
    
    
    CHECKS when added, will also be copied to to the table attributes.  FK
    Constraints (if I ever figure out how) will be done similarly.  Both
    will lbe handled by MergeDomainAttributes() which is called shortly
    before MergeAttributes().
    
    Rod Taylor
    01c76f74
drop_domain.sgml 3.83 KB
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_domain.sgml,v 1.1 2002/03/06 20:34:44 momjian Exp $
PostgreSQL documentation
-->

<refentry id="SQL-DROPDOMAIN">
 <refmeta>
  <refentrytitle id="SQL-DROPDOMAIN-TITLE">
   DROP DOMAIN
  </refentrytitle>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>
 <refnamediv>
  <refname>
   DROP DOMAIN
  </refname>
  <refpurpose>
   remove a user-defined domain
  </refpurpose>
 </refnamediv>
 <refsynopsisdiv>
  <refsynopsisdivinfo>
   <date>1999-07-20</date>
  </refsynopsisdivinfo>
  <synopsis>
DROP DOMAIN <replaceable class="PARAMETER">domainname</replaceable> [, ...]
  </synopsis>

  <refsect2 id="R2-SQL-DROPDOMAIN-1">
   <refsect2info>
    <date>2002-02-24</date>
   </refsect2info>
   <title>
    Inputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><replaceable class="PARAMETER">domainname</replaceable></term>
      <listitem>
       <para>
	The name of an existing domain.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>

  <refsect2 id="R2-SQL-DROPDOMAIN-2">
   <refsect2info>
    <date>2002-02-24</date>
   </refsect2info>
   <title>
    Outputs
   </title>
   <para>
    <variablelist>
     <varlistentry>
      <term><computeroutput>
DROP
       </computeroutput></term>
      <listitem>
       <para>
	The message returned if the command is successful.
       </para>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term><computeroutput>
ERROR:  RemoveDomain: type '<replaceable class="parameter">domainname</replaceable>' does not exist
       </computeroutput></term>
      <listitem>
       <para>
	This message occurs if the specified domain (or type) is not found.
       </para>
      </listitem>
     </varlistentry>
    </variablelist>
   </para>
  </refsect2>
 </refsynopsisdiv>

 <refsect1 id="R1-SQL-DROPDOMAIN-1">
  <refsect1info>
   <date>2002-02-24</date>
  </refsect1info>
  <title>
   Description
  </title>
  <para>
   <command>DROP DOMAIN</command> will remove a user domain from the
   system catalogs.
  </para>
  <para>
   Only the owner of a domain can remove it.
  </para>
 </refsect1>

 <refsect1 id="SQL-DROPDOMAIN-notes">
  <title>Notes</title>

  <itemizedlist>
   <listitem>
    <para>
     It is the user's responsibility to remove any operators,
     functions, aggregates, access methods, and tables that
     use a deleted domain.
    </para>
   </listitem>
  </itemizedlist>
 </refsect1>

 <refsect1 id="SQL-DROPDOMAIN-examples">
  <title>Examples</title>
  <para>
   To remove the <type>box</type> domain:

<programlisting>
DROP DOMAIN box RESTRICT;
</programlisting>
  </para>
 </refsect1>

 <refsect1 id="SQL-DROPDOMAIN-compatibility">
  <title>Compatibility</title>

  <para>
   A <command>DROP DOMAIN</command> statement exists in SQL99.  As with
   most other <quote>drop</quote> commands, <command>DROP
   DOMAIN</command> in SQL99 requires a <quote>drop behavior</quote>
   clause to select between dropping all dependent objects or refusing
   to drop if dependent objects exist:
<synopsis>
DROP DOMAIN <replaceable>name</replaceable> { CASCADE | RESTRICT }
</synopsis>
   <productname>PostgreSQL</productname> enforces the existance of
   RESTRICT or CASCADE but ignores their enforcement against the
   system tables.
  </para>
 </refsect1>

 <refsect1 id="SQL-DROPDOMAIN-see-also">
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-createdomain"></member>
  </simplelist>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->