|
|
|
|
| <!DOCTYPE html>
|
|
|
| <html lang="en" data-content_root="./">
|
| <head>
|
| <meta charset="utf-8" />
|
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
| <title>Domain Dialog — pgAdmin 4 8.6 documentation</title>
|
| <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
|
| <link rel="stylesheet" type="text/css" href="_static/style.css?v=d36593c3" />
|
|
|
| <script src="_static/documentation_options.js?v=d4c83366"></script>
|
| <script src="_static/doctools.js?v=9a2dae69"></script>
|
| <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
|
| <script src="_static/sidebar.js"></script>
|
|
|
| <link rel="index" title="Index" href="genindex.html" />
|
| <link rel="search" title="Search" href="search.html" />
|
| <link rel="next" title="Domain Constraints Dialog" href="domain_constraint_dialog.html" />
|
| <link rel="prev" title="Collation Dialog" href="collation_dialog.html" />
|
| </head><body>
|
| <div class="related" role="navigation" aria-label="related navigation">
|
| <h3>Navigation</h3>
|
| <ul>
|
| <li class="right" style="margin-right: 10px">
|
| <a href="genindex.html" title="General Index"
|
| accesskey="I">index</a></li>
|
| <li class="right" >
|
| <a href="domain_constraint_dialog.html" title="Domain Constraints Dialog"
|
| accesskey="N">next</a> |</li>
|
| <li class="right" >
|
| <a href="collation_dialog.html" title="Collation Dialog"
|
| accesskey="P">previous</a> |</li>
|
| <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> »</li>
|
| <li class="nav-item nav-item-1"><a href="managing_database_objects.html" accesskey="U">Managing Database Objects</a> »</li>
|
| <li class="nav-item nav-item-this"><a href="">Domain Dialog</a></li>
|
| </ul>
|
| </div>
|
|
|
| <div class="document">
|
| <div class="documentwrapper">
|
| <div class="bodywrapper">
|
| <div class="body" role="main">
|
|
|
| <section id="domain-dialog">
|
| <span id="id1"></span><h1><span class="target" id="index-0"></span>Domain Dialog<a class="headerlink" href="#domain-dialog" title="Link to this heading">¶</a></h1>
|
| <p>Use the <em>Domain</em> dialog to define a domain. A domain is a data type definition
|
| that may constrain permissible values. Domains are useful when you are creating
|
| multiple tables that contain comparable columns; you can create a domain that
|
| defines constraints that are common to the columns and re-use the domain
|
| definition when creating the columns, rather than individually defining each
|
| set of constraints.</p>
|
| <p>The <em>Domain</em> dialog organizes the development of a domain through the following
|
| tabs: <em>General</em>, <em>Definition</em>, <em>Constraints</em>, and <em>Security</em>. The <em>SQL</em> tab
|
| displays the SQL code generated by dialog selections.</p>
|
| <img alt="Domain dialog general tab" class="align-center" src="_images/domain_general.png" />
|
| <p>Use the fields on the <em>General</em> tab to identify a domain:</p>
|
| <ul class="simple">
|
| <li><p>Use the <em>Name</em> field to add a descriptive name for the domain. The name will
|
| be displayed in the <em>pgAdmin</em> tree control.</p></li>
|
| <li><p>Use the drop-down listbox next to <em>Owner</em> to select a role that will own the
|
| domain.</p></li>
|
| <li><p>Select the name of the schema in which the domain will reside from the
|
| drop-down listbox in the <em>Schema</em> field.</p></li>
|
| <li><p>Store notes about the domain in the <em>Comment</em> field.</p></li>
|
| </ul>
|
| <p>Click the <em>Definition</em> tab to continue.</p>
|
| <img alt="Domain dialog definition tab" class="align-center" src="_images/domain_definition.png" />
|
| <p>Use the fields in the <em>Definition</em> tab to describe the domain:</p>
|
| <ul class="simple">
|
| <li><p>Use the drop-down listbox next to <em>Base type</em> to specify a data type.</p></li>
|
| <li><p>Use the context-sensitive <em>Length</em> field to specify a numeric length for a
|
| numeric type.</p></li>
|
| <li><p>Use the context-sensitive <em>Precision</em> field to specify the total count of
|
| significant digits for a numeric type.</p></li>
|
| <li><p>Specify a default value for the domain data type in the <em>Default</em> field. The
|
| data type of the default expression must match the data type of the domain. If
|
| no default value is specified, then the default value is the null value.</p></li>
|
| <li><p>Move the <em>Not Null</em> switch to specify the values of this domain are prevented
|
| from being null.</p></li>
|
| <li><p>Use the drop-down listbox next to <em>Collation</em> to apply a collation cast. If
|
| no collation is specified, the underlying data type’s default collation is
|
| used. The underlying type must be collatable if COLLATE is specified.</p></li>
|
| </ul>
|
| <p>Click the <em>Constraints</em> tab to continue.</p>
|
| <img alt="Domain dialog constraints tab" class="align-center" src="_images/domain_constraints.png" />
|
| <p>Use the fields in the <em>Constraints</em> tab to specify rules for the domain. Click
|
| the <em>Add</em> icon (+) to set constraints:</p>
|
| <ul class="simple">
|
| <li><p>Use the <em>Name</em> field to specify a name for the constraint.</p></li>
|
| <li><p>Use the <em>Check</em> field to provide an expression for the constraint.</p></li>
|
| <li><p>Use the <em>Validate</em> checkbox to determine whether the constraint will be
|
| validated. The default checkbox is checked and sets a validation requirement.</p></li>
|
| </ul>
|
| <p>A CHECK clause specifies an integrity test which values of the domain must
|
| satisfy. Each constraint must be an expression that produces a Boolean result.
|
| Use the key word VALUE to refer to the value being tested. Expressions
|
| evaluating to TRUE or UNKNOWN succeed. If the expression produces a FALSE
|
| result, an error is reported and the value is not allowed to be converted to
|
| the domain type. A CHECK expression cannot contain subqueries nor refer to
|
| variables other than VALUE. If a domain has multiple CHECK constraints, they
|
| will be tested in alphabetical order by name.</p>
|
| <p>Click the <em>Add</em> icon (+) to set additional constraints; to discard a constraint,
|
| click the trash icon to the left of the row and confirm deletion in the <em>Delete
|
| Row</em> popup.</p>
|
| <p>Click the <em>Security</em> tab to continue.</p>
|
| <img alt="Domain dialog security tab" class="align-center" src="_images/domain_security.png" />
|
| <p>Use the <em>Security Labels</em> panel to assign security labels. Click the <em>Add</em> icon
|
| (+) to add a label:</p>
|
| <ul class="simple">
|
| <li><p>Specify a security label provider in the <em>Provider</em> field. The named provider
|
| must be loaded and must consent to the proposed labeling operation.</p></li>
|
| <li><p>Specify a a security label in the <em>Security Label</em> field. The meaning of a
|
| given label is at the discretion of the label provider. PostgreSQL places no
|
| restrictions on whether or how a label provider must interpret security
|
| labels; it merely provides a mechanism for storing them.</p></li>
|
| </ul>
|
| <p>Click the <em>Add</em> icon (+) to specify each additional label; to discard a label,
|
| click the trash icon to the left of the row and confirm deletion in the <em>Delete
|
| Row</em> popup.</p>
|
| <p>Click the <em>SQL</em> tab to continue.</p>
|
| <p>Your entries in the <em>Domain</em> dialog generate a SQL command (see an example
|
| below). Use the <em>SQL</em> tab for review; revisit or switch tabs to make any changes
|
| to the SQL command.</p>
|
| <section id="example">
|
| <h2>Example<a class="headerlink" href="#example" title="Link to this heading">¶</a></h2>
|
| <p>The following is an example of the sql command generated by selections made in
|
| the <em>Domain</em> dialog:</p>
|
| <img alt="Domain dialog sql tab" class="align-center" src="_images/domain_sql.png" />
|
| <p>The example shown demonstrates creating a domain named <em>postal_code</em> that
|
| confirms that the value entered is in proper format.</p>
|
| <ul class="simple">
|
| <li><p>Click the <em>Info</em> button (i) to access online help.</p></li>
|
| <li><p>Click the <em>Save</em> button to save work.</p></li>
|
| <li><p>Click the <em>Close</em> button to exit without saving work.</p></li>
|
| <li><p>Click the <em>Reset</em> button to restore configuration parameters.</p></li>
|
| </ul>
|
| </section>
|
| </section>
|
|
|
|
|
| <div class="clearer"></div>
|
| </div>
|
| </div>
|
| </div>
|
| <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
| <div class="sphinxsidebarwrapper">
|
| <div>
|
| <h3><a href="index.html">Table of Contents</a></h3>
|
| <ul>
|
| <li><a class="reference internal" href="#">Domain Dialog</a><ul>
|
| <li><a class="reference internal" href="#example">Example</a></li>
|
| </ul>
|
| </li>
|
| </ul>
|
|
|
| </div>
|
| <h3><a href="index.html">Table of Contents</a></h3>
|
| <ul class="current">
|
| <li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="external_database.html">External database for pgAdmin user settings</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="connecting.html">Connecting To A Server</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="managing_cluster_objects.html">Managing Cluster Objects</a></li>
|
| <li class="toctree-l1 current"><a class="reference internal" href="managing_database_objects.html">Managing Database Objects</a><ul class="current">
|
| <li class="toctree-l2"><a class="reference internal" href="cast_dialog.html">Cast Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="dbms_job_scheduler.html">Using EDB Job Scheduler</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="collation_dialog.html">Collation Dialog</a></li>
|
| <li class="toctree-l2 current"><a class="current reference internal" href="#">Domain Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="domain_constraint_dialog.html">Domain Constraints Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="event_trigger_dialog.html">Event Trigger Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="extension_dialog.html">Extension Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="foreign_data_wrapper_dialog.html">Foreign Data Wrapper Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="foreign_server_dialog.html">Foreign Server Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="foreign_table_dialog.html">Foreign Table Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="fts_configuration_dialog.html">FTS Configuration Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="fts_dictionary_dialog.html">FTS Dictionary Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="fts_parser_dialog.html">FTS Parser Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="fts_template_dialog.html">FTS Template Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="function_dialog.html">Function Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="language_dialog.html">Language Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="materialized_view_dialog.html">Materialized View Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="package_dialog.html">Package Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="procedure_dialog.html">Procedure Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="publication_dialog.html">Publication Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="schema_dialog.html">Schema Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="sequence_dialog.html">Sequence Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="subscription_dialog.html">Subscription Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="synonym_dialog.html">Synonym Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="trigger_function_dialog.html">Trigger Function Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="type_dialog.html">Type Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="user_mapping_dialog.html">User Mapping Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="view_dialog.html">View Dialog</a></li>
|
| </ul>
|
| </li>
|
| <li class="toctree-l1"><a class="reference internal" href="modifying_tables.html">Creating or Modifying a Table</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="management_basics.html">Management Basics</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="backup_and_restore.html">Backup and Restore</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="processes.html">Processes</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="pgagent.html">pgAgent</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="contributions.html">pgAdmin Project Contributions</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="release_notes.html">Release Notes</a></li>
|
| <li class="toctree-l1"><a class="reference internal" href="licence.html">Licence</a></li>
|
| </ul>
|
|
|
| <search id="searchbox" style="display: none" role="search">
|
| <h3 id="searchlabel">Quick search</h3>
|
| <div class="searchformwrapper">
|
| <form class="search" action="search.html" method="get">
|
| <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
| <input type="submit" value="Go" />
|
| </form>
|
| </div>
|
| </search>
|
| <script>document.getElementById('searchbox').style.display = "block"</script>
|
| </div>
|
| <div id="sidebarbutton" title="Collapse sidebar">
|
| <span>«</span>
|
| </div>
|
|
|
| </div>
|
| <div class="clearer"></div>
|
| </div>
|
| <div class="related" role="navigation" aria-label="related navigation">
|
| <h3>Navigation</h3>
|
| <ul>
|
| <li class="right" style="margin-right: 10px">
|
| <a href="genindex.html" title="General Index"
|
| >index</a></li>
|
| <li class="right" >
|
| <a href="domain_constraint_dialog.html" title="Domain Constraints Dialog"
|
| >next</a> |</li>
|
| <li class="right" >
|
| <a href="collation_dialog.html" title="Collation Dialog"
|
| >previous</a> |</li>
|
| <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> »</li>
|
| <li class="nav-item nav-item-1"><a href="managing_database_objects.html" >Managing Database Objects</a> »</li>
|
| <li class="nav-item nav-item-this"><a href="">Domain Dialog</a></li>
|
| </ul>
|
| </div>
|
| <div class="footer" role="contentinfo">
|
| <div class="related" role="navigation" aria-label="related navigation">
|
| <ul>
|
| <li class="left" style="margin-left: 10px">© Copyright (C) 2013 - 2024, The pgAdmin Development Team.</li>
|
| <li class="right" style="margin-right: 10px"><a href="genindex.html" title="General Index" accesskey="I">index</a></li>
|
| <li class="right" ><a href="domain_constraint_dialog.html" title="Domain Constraints Dialog" accesskey="N">next</a> |</li>
|
| <li class="right" ><a href="collation_dialog.html" title="Collation Dialog" accesskey="P">previous</a> |</li>
|
| </ul>
|
| </div>
|
| </div>
|
| </body>
|
| </html> |