|
|
|
|
| <!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>Column 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="Compound Trigger Dialog" href="compound_trigger_dialog.html" />
|
| <link rel="prev" title="Check Dialog" href="check_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="compound_trigger_dialog.html" title="Compound Trigger Dialog"
|
| accesskey="N">next</a> |</li>
|
| <li class="right" >
|
| <a href="check_dialog.html" title="Check 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="modifying_tables.html" accesskey="U">Creating or Modifying a Table</a> »</li>
|
| <li class="nav-item nav-item-this"><a href="">Column Dialog</a></li>
|
| </ul>
|
| </div>
|
|
|
| <div class="document">
|
| <div class="documentwrapper">
|
| <div class="bodywrapper">
|
| <div class="body" role="main">
|
|
|
| <section id="column-dialog">
|
| <span id="id1"></span><h1><span class="target" id="index-0"></span>Column Dialog<a class="headerlink" href="#column-dialog" title="Link to this heading">¶</a></h1>
|
| <p>Use the <em>Column</em> dialog to add a column to an existing table or modify a column
|
| definition.</p>
|
| <p>The <em>Column</em> dialog organizes the development of a column through the following
|
| dialog tabs: <em>General</em>, <em>Definition</em>, and <em>Security</em>. The <em>SQL</em> tab displays the
|
| SQL code generated by dialog selections.</p>
|
| <img alt="Column dialog general tab" class="align-center" src="_images/column_general.png" />
|
| <p>Use the fields in the <em>General</em> tab to identify the column:</p>
|
| <ul class="simple">
|
| <li><p>Use the <em>Name</em> field to add a descriptive name for the column. The name will
|
| be displayed in the <em>pgAdmin</em> tree control. This field is required.</p></li>
|
| <li><p>Store notes about the column in the <em>Comment</em> field.</p></li>
|
| </ul>
|
| <p>Click the <em>Definition</em> tab to continue.</p>
|
| <img alt="Column dialog definition tab" class="align-center" src="_images/column_definition.png" />
|
| <p>Use the fields in the <em>Definition</em> tab to add parameters for the column. (Fields
|
| are disabled if inapplicable.)</p>
|
| <ul class="simple">
|
| <li><p>Use the drop-down listbox next to <em>Data Type</em> to select a data type for the
|
| column. For more information on the data types that are supported by
|
| PostgreSQL, refer to Chapter 8 of the Postgres core documentation. This field
|
| is required.</p></li>
|
| <li><p>Use the <em>Length/Precision</em> and <em>Scale</em> fields to specify the maximum number of
|
| significant digits in a numeric value, or the maximum number of characters in
|
| a text value.</p></li>
|
| <li><p>Use the drop-down listbox next to <em>Collation</em> to apply a collation setting to
|
| the column.</p></li>
|
| <li><p>Use the drop-down listbox next to <em>Compression</em> to set the compression method
|
| for the column. Compression is supported only for variable-width data types,
|
| and is used only when the column’s storage mode is main or extended. This
|
| option is available from v14 and above.</p></li>
|
| <li><p>Use the drop-down listbox next to <em>Storage</em> to set the storage mode for the
|
| column. This option is available from v16 and above.</p></li>
|
| </ul>
|
| <p>Click the <em>Constraints</em> tab to continue.</p>
|
| <img alt="Column dialog constraints tab" class="align-center" src="_images/column_constraints.png" />
|
| <p>Use the fields in the <em>Constraints</em> tab to specify constraints for the column.
|
| (Fields are disabled if inapplicable.)</p>
|
| <ul class="simple">
|
| <li><p>Use the <em>Default Value</em> field to specify a default data value.</p></li>
|
| <li><p>Move the <em>Not Null</em> switch to the <em>Yes</em> position to specify the column may not
|
| contain null values. The default is <em>No</em>.</p></li>
|
| <li><p>Use the <em>Type</em> field to specify the column type (NONE/IDENTITY/GENERATED).
|
| The default is <em>NONE</em>.</p></li>
|
| </ul>
|
| <p>Click the <em>IDENTITY</em> type to create Identity column.</p>
|
| <img alt="Column dialog constraints tab" class="align-center" src="_images/column_constraint_identity.png" />
|
| <p>Use the following fields to create <em>IDENTITY</em> column. Identity columns are
|
| applicable for PG/EPAS version 10 and above.</p>
|
| <ul class="simple">
|
| <li><p>Use the <em>Identity</em> field to specify ALWAYS or BY DEFAULT. This clause is
|
| used to determine how the sequence value is given precedence over a
|
| user-specified value in an INSERT statement.</p></li>
|
| <li><p>Use the <em>Increment</em> field to specify which value is added to the current
|
| sequence value to create a new value.</p></li>
|
| <li><p>Provide a value in the <em>Start</em> field to specify the beginning value of the
|
| sequence. The default starting value is MINVALUE for ascending sequences and
|
| MAXVALUE for descending ones.</p></li>
|
| <li><p>Provide a value in the <em>Minimum</em> field to specify the minimum value a sequence
|
| can generate. If this clause is not supplied or NO MINVALUE is specified,
|
| then defaults will be used. The defaults are 1 and -263-1 for ascending and
|
| descending sequences, respectively.</p></li>
|
| <li><p>Provide a value in the <em>Maximum</em> field to specify the maximum value for the
|
| sequence. If this clause is not supplied or NO MAXVALUE is specified, then
|
| default values will be used. The defaults are 263-1 and -1 for ascending and
|
| descending sequences, respectively.</p></li>
|
| <li><p>Provide a value in the <em>Cache</em> field to specify how many sequence numbers are
|
| to be preallocated and stored in memory for faster access. The minimum value
|
| is 1 (only one value can be generated at a time, i.e., no cache), and this is
|
| also the default.</p></li>
|
| <li><p>Move the <em>Cycled</em> switch to the <em>Yes</em> position to allow the sequence to wrap
|
| around when the MAXVALUE or the MINVALUE has been reached by an ascending or
|
| descending sequence respectively. If the limit is reached, the next number
|
| generated will be the MINVALUE or MAXVALUE, respectively. The default is <em>No</em>.</p></li>
|
| </ul>
|
| <p>Click the <em>GENERATED</em> type to create Generated column.</p>
|
| <img alt="Column dialog constraints tab" class="align-center" src="_images/column_constraint_generated.png" />
|
| <p>Use the following fields to create <em>GENERATED</em> column. Generated columns are
|
| applicable for PG/EPAS version 12 and above.</p>
|
| <ul class="simple">
|
| <li><p>Use the <em>Expression</em> field to specify the generation expression. It can
|
| refer to other columns in the table, but not other generated columns.
|
| Any functions and operators used must be immutable. References to other
|
| tables are not allowed.</p></li>
|
| </ul>
|
| <p>Click the <em>Variables</em> tab to continue.</p>
|
| <img alt="Column dialog variables tab" class="align-center" src="_images/column_variables.png" />
|
| <p>Use the <em>Variables</em> tab to specify the number of distinct values that may be
|
| present in the column; this value overrides estimates made by the ANALYZE
|
| command. Click the <em>Add</em> icon (+) to add a <em>Name</em>/<em>Value</em> pair:</p>
|
| <ul>
|
| <li><p>Select the name of the variable from the drop-down listbox in the <em>Name</em> field.</p>
|
| <blockquote>
|
| <div><ul class="simple">
|
| <li><p>Select <em>n_distinct</em> to specify the number of distinct values for the column.</p></li>
|
| <li><p>Select <em>n_distinct_inherited</em> to specify the number of distinct values
|
| for the table and its children.</p></li>
|
| </ul>
|
| </div></blockquote>
|
| </li>
|
| <li><p>Specify the number of distinct values in the <em>Value</em> field. For more
|
| information, see the documentation for
|
| <a class="reference external" href="https://www.postgresql.org/docs/current/sql-altertable.html">ALTER TABLE</a>.</p></li>
|
| </ul>
|
| <p>Click the <em>Add</em> icon (+) to specify each additional <em>Name</em>/<em>Value</em> pair; to
|
| discard a variable, 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="Column dialog security tab" class="align-center" src="_images/column_security.png" />
|
| <p>Use the <em>Security</em> tab to assign attributes and define security labels. Click
|
| the <em>Add</em> icon (+) to add each security label selection:</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 assign additional security labels; to discard a
|
| security 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>Column</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 user selections in
|
| the <em>Column</em> dialog:</p>
|
| <img alt="Column dialog sql tab" class="align-center" src="_images/column_sql.png" />
|
| <p>The example shown demonstrates creating a column named <em>sal</em> in the table
|
| named <em>jobhist</em>.</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="#">Column 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"><a class="reference internal" href="managing_database_objects.html">Managing Database Objects</a></li>
|
| <li class="toctree-l1 current"><a class="reference internal" href="modifying_tables.html">Creating or Modifying a Table</a><ul class="current">
|
| <li class="toctree-l2"><a class="reference internal" href="check_dialog.html">Check Dialog</a></li>
|
| <li class="toctree-l2 current"><a class="current reference internal" href="#">Column Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="compound_trigger_dialog.html">Compound Trigger Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="exclusion_constraint_dialog.html">Exclusion Constraint Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="foreign_key_dialog.html">Foreign key Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="index_dialog.html">Index Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="primary_key_dialog.html">Primary key Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="rls_policy_dialog.html">RLS Policy Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="rule_dialog.html">Rule Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="table_dialog.html">Table Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="trigger_dialog.html">Trigger Dialog</a></li>
|
| <li class="toctree-l2"><a class="reference internal" href="unique_constraint_dialog.html">Unique Constraint Dialog</a></li>
|
| </ul>
|
| </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="compound_trigger_dialog.html" title="Compound Trigger Dialog"
|
| >next</a> |</li>
|
| <li class="right" >
|
| <a href="check_dialog.html" title="Check 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="modifying_tables.html" >Creating or Modifying a Table</a> »</li>
|
| <li class="nav-item nav-item-this"><a href="">Column 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="compound_trigger_dialog.html" title="Compound Trigger Dialog" accesskey="N">next</a> |</li>
|
| <li class="right" ><a href="check_dialog.html" title="Check Dialog" accesskey="P">previous</a> |</li>
|
| </ul>
|
| </div>
|
| </div>
|
| </body>
|
| </html> |