File size: 10,680 Bytes
66b3b8e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180


<!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>Check Dialog &#8212; 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="Column Dialog" href="column_dialog.html" />
    <link rel="prev" title="Creating or Modifying a Table" href="modifying_tables.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="column_dialog.html" title="Column Dialog"

             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="modifying_tables.html" title="Creating or Modifying a Table"

             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="modifying_tables.html" accesskey="U">Creating or Modifying a Table</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Check Dialog</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="check-dialog">
<span id="id1"></span><h1><span class="target" id="index-0"></span>Check Dialog<a class="headerlink" href="#check-dialog" title="Link to this heading"></a></h1>
<p>Use the <em>Check</em> dialog to define or modify a check constraint. A check
constraint specifies an expression that produces a Boolean result that new or
updated rows must satisfy for an insert or update operation to succeed.</p>
<p>The <em>Check</em> dialog organizes the development of a check constraint through the
<em>General</em> and <em>Definition</em> tabs. The <em>SQL</em> tab displays the SQL code generated
by dialog selections.</p>
<img alt="Check dialog general tab" class="align-center" src="_images/check_general.png" />
<p>Use the fields in the <em>General</em> tab to identify the check constraint:</p>
<ul class="simple">
<li><p>Use the <em>Name</em> field to provide a descriptive name for the check constraint
that will be displayed in the <em>pgAdmin</em> tree control. With PostgreSQL 9.5
forward, when a table has multiple check constraints, they will be tested for
each row in alphabetical order by name and after NOT NULL constraints.</p></li>
<li><p>Store notes about the check constraint in the <em>Comment</em> field.</p></li>
</ul>
<p>Click the <em>Definition</em> tab to continue.</p>
<img alt="Check dialog definition tab" class="align-center" src="_images/check_definition.png" />
<p>Use the fields in the <em>Definition</em> tab to define the check constraint:</p>
<ul class="simple">
<li><p>Provide the expression that a row must satisfy in the <em>Check</em> field.</p></li>
<li><p>Move the <em>No Inherit?</em> switch to the <em>Yes</em> position to specify that this
constraint is not automatically inherited by a table’s children. The default
is <em>No</em>, meaning that the constraint will be inherited by any children.</p></li>
<li><p>Move the <em>Don’t validate?</em> switch to the <em>No</em> position to skip validation of
existing data; the constraint may not hold for all rows in the table. The
default is <em>Yes</em>.</p></li>
</ul>
<p>Click the <em>SQL</em> tab to continue.</p>
<p>Your entries in the <em>Check</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>
<p><strong>Example</strong></p>
<p>The following is an example of the sql command generated by user selections in
the <em>Check</em> dialog:</p>
<img alt="Check dialog sql tab" class="align-center" src="_images/check_sql.png" />
<p>The example shown demonstrates creating a check constraint named <em>jobhist_date_chk</em>
on the <em>startdate</em> column of the <em>jobhist</em> table.</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>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<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 current"><a class="current reference internal" href="#">Check Dialog</a></li>
<li class="toctree-l2"><a class="reference internal" href="column_dialog.html">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="column_dialog.html" title="Column Dialog"

             >next</a> |</li>
        <li class="right" >
          <a href="modifying_tables.html" title="Creating or Modifying a Table"

             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="modifying_tables.html" >Creating or Modifying a Table</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Check 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">&#169; 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="column_dialog.html" title="Column Dialog" accesskey="N">next</a> |</li>
            <li class="right" ><a href="modifying_tables.html" title="Creating or Modifying a Table" accesskey="P">previous</a> |</li>
          </ul>
        </div>
    </div>
  </body>
</html>