Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
table_dialog.html634 linesDownload Raw Back to html
1
2
3<!DOCTYPE html>
4
5<html lang="en" data-content_root="./">
6  <head>
7    <meta charset="utf-8" />
8    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
9
10    <title>Table Dialog &#8212; pgAdmin 4 8.6 documentation</title>
11    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
12    <link rel="stylesheet" type="text/css" href="_static/style.css?v=d36593c3" />
13    
14    <script src="_static/documentation_options.js?v=d4c83366"></script>
15    <script src="_static/doctools.js?v=9a2dae69"></script>
16    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
17    
18    <script src="_static/sidebar.js"></script>
19    
20    <link rel="index" title="Index" href="genindex.html" />
21    <link rel="search" title="Search" href="search.html" />
22    <link rel="next" title="Trigger Dialog" href="trigger_dialog.html" />
23    <link rel="prev" title="Rule Dialog" href="rule_dialog.html" /> 
24  </head><body>
25    <div class="related" role="navigation" aria-label="related navigation">
26      <h3>Navigation</h3>
27      <ul>
28        <li class="right" style="margin-right: 10px">
29          <a href="genindex.html" title="General Index"
30             accesskey="I">index</a></li>
31        <li class="right" >
32          <a href="trigger_dialog.html" title="Trigger Dialog"
33             accesskey="N">next</a> |</li>
34        <li class="right" >
35          <a href="rule_dialog.html" title="Rule Dialog"
36             accesskey="P">previous</a> |</li>
37        <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> &#187;</li>
38          <li class="nav-item nav-item-1"><a href="modifying_tables.html" accesskey="U">Creating or Modifying a Table</a> &#187;</li>
39        <li class="nav-item nav-item-this"><a href="">Table Dialog</a></li> 
40      </ul>
41    </div>  
42
43    <div class="document">
44      <div class="documentwrapper">
45        <div class="bodywrapper">
46          <div class="body" role="main">
47            
48  <section id="table-dialog">
49<span id="id1"></span><h1><span class="target" id="index-0"></span>Table Dialog<a class="headerlink" href="#table-dialog" title="Link to this heading">¶</a></h1>
50<p>Use the <em>Table</em> dialog to create or modify a table.</p>
51<p>The <em>Table</em> dialog organizes the development of a table through the following
52dialog tabs: <em>General</em>, <em>Columns</em>, <em>Constraints</em>, <em>Advanced</em>, <em>Parition</em>, <em>Parameter</em>, and
53<em>Security</em>. The <em>SQL</em> tab displays the SQL code generated by dialog selections.</p>
54<img alt="Table dialog general tab" class="align-center" src="_images/table_general.png" />
55<p>Use the fields in the <em>General</em> tab to identify the table:</p>
56<ul class="simple">
57<li><p>Use the <em>Name</em> field to add a descriptive name for the table. A table cannot
58have the same name as any existing table, sequence, index, view, foreign
59table, or data type in the same schema. The name specified will be displayed
60in the <em>pgAdmin</em> tree control. This field is required.</p></li>
61<li><p>Select the owner of the table from the drop-down listbox in the <em>Owner</em> field.
62By default, the owner of the table is the role that creates the table.</p></li>
63<li><p>Select the name of the schema in which the table will reside from the
64drop-down listbox in the <em>Schema</em> field.</p></li>
65<li><p>Use the drop-down listbox in the <em>Tablespace</em> field to specify the tablespace
66in which the table will be stored.</p></li>
67<li><p>Move the <em>Partitioned Table?</em> switch to the <em>Yes</em> in case you want to create a
68partitioned table. Option is available for PostgreSQL 10 and above.</p></li>
69<li><p>Store notes about the table in the <em>Comment</em> field.</p></li>
70</ul>
71<p>Click the <em>Columns</em> tab to continue.</p>
72<img alt="Table dialog columns tab" class="align-center" src="_images/table_columns.png" />
73<p>Use the drop-down listbox next to <em>Inherited from table(s)</em> to specify any
74parent table(s); the table will inherit columns from the selected parent
75table(s). Click inside the <em>Inherited from table(s)</em> field to select a table
76name from a drop-down list. Repeat to add any other parent tables. Delete a
77selected table by clicking the <em>x</em> to the left of the parent name. Note that
78inherited column names and datatypes are not editable in the current dialog;
79they must be modified at the parent level.</p>
80<p>Click the <em>Add</em> icon (+) to specify the names of columns and their datatypes in
81the <em>Columns</em> table:</p>
82<ul class="simple">
83<li><p>Use the <em>Name</em> field to add a descriptive name for the column.</p></li>
84<li><p>Use the drop-down listbox in the <em>Data type</em> field to select a data type for
85the column. This can include array specifiers. For more information on the
86data types supported by PostgreSQL, refer to Chapter 8 of the core
87documentation.</p></li>
88<li><p>If enabled, use the <em>Length/Precision</em> and <em>Scale</em> fields to specify the
89maximum number of significant digits in a numeric value, or the maximum
90number of characters in a text value.</p></li>
91<li><p>Move the <em>Not NULL?</em> switch to the <em>Yes</em> position to require a value in the
92column field.</p></li>
93<li><p>Move the <em>Primary key?</em> switch to the <em>Yes</em> position to specify the column is
94the primary key constraint.</p></li>
95</ul>
96<p>Click the <em>Add</em> icon (+) to add additional columns; to discard a column, click
97the trash icon to the left of the row and confirm deletion in the <em>Delete Row</em>
98popup.</p>
99<p>Click the <em>Constraints</em> tab to continue.</p>
100<img alt="Table dialog constraints tab" class="align-center" src="_images/table_constraints.png" />
101<p>Use the fields in the <em>Constraints</em> tab to provide a table or column constraint.
102Optional constraint clauses specify constraints (tests) that new or updated rows
103must satisfy for an <em>INSERT</em> or <em>UPDATE</em> operation to succeed. Select the
104appropriate constraint type by selecting one of the following tabs on the
105<em>Constraints</em> panel:</p>
106<table class="longtable docutils align-default">
107<colgroup>
108<col style="width: 20.0%" />
109<col style="width: 80.0%" />
110</colgroup>
111<thead>
112<tr class="row-odd"><th class="head"><p>Tab Name</p></th>
113<th class="head"><p>Constraint</p></th>
114</tr>
115</thead>
116<tbody>
117<tr class="row-even"><td><p><em>Primary Key</em></p></td>
118<td><p>Provides a unique identifier for each row in the table.</p></td>
119</tr>
120<tr class="row-odd"><td><p><em>Foreign Key</em></p></td>
121<td><p>Maintains referential integrity between two tables.</p></td>
122</tr>
123<tr class="row-even"><td><p><em>Check</em></p></td>
124<td><p>Requires data satisfies an expression or condition before insertion or modification.</p></td>
125</tr>
126<tr class="row-odd"><td><p><em>Unique</em></p></td>
127<td><p>Ensures that the data contained in a column, or a group of columns, is unique among all the rows in the table.</p></td>
128</tr>
129<tr class="row-even"><td><p><em>Exclude</em></p></td>
130<td><p>Guarantees that if any two rows are compared on the specified column or expression (using the specified operator),
131at least one of the operator comparisons will return false or null.</p></td>
132</tr>
133</tbody>
134</table>
135<p>To add a primary key for the table, select the <em>Primary Key</em> tab, and click the
136<em>Add</em> icon (+). To define the primary key, click the <em>Edit</em> icon to the left of
137the <em>Trash</em> icon. A dialog similar to the <em>Primary key</em> dialog (accessed by
138right clicking on <em>Constraints</em> in the <em>pgAdmin</em> tree control)  opens.</p>
139<p>Use the fields in the <em>General</em> tab to identify the primary key:</p>
140<ul class="simple">
141<li><p>Use the <em>Name</em> field to add a descriptive name for the primary key constraint.
142The name will be displayed in the <em>pgAdmin</em> tree control.</p></li>
143<li><p>Provide notes about the primary key in the <em>Comment</em> field.</p></li>
144</ul>
145<p>Click the <em>Definition</em> tab to continue.</p>
146<img alt="Table dialog primary key constraint definition" class="align-center" src="_images/primary_key_definition.png" />
147<p>Use the fields in the <em>Definition</em> tab to define the primary key constraint:</p>
148<ul class="simple">
149<li><p>Click inside the <em>Columns</em> field and select one or more column names from the
150drop-down listbox. To delete a selection, click the <em>x</em> to the left of the
151column name. The primary key constraint should be different from any unique
152constraint defined for the same table; the selected column(s) for the
153constraints must be distinct.</p></li>
154<li><p>Select the name of the tablespace in which the primary key constraint will
155reside from the drop-down listbox in the <em>Tablespace</em> field.</p></li>
156<li><p>Use the <em>Fill Factor</em> field to specify a fill factor for the table and index.
157The fill factor for a table is a percentage between 10 and 100. 100 (complete
158packing) is the default.</p></li>
159<li><p>Move the <em>Deferrable?</em> switch to the <em>Yes</em> position to specify the timing of
160the constraint is deferrable and can be postponed until the end of the
161statement. The default is <em>No</em>.</p></li>
162<li><p>If enabled, move the <em>Deferred?</em> switch to the <em>Yes</em> position to specify the
163timing of the constraint is deferred to the end of the statement. The default
164is <em>No</em>.</p></li>
165</ul>
166<img alt="Table dialog foreign key constrain" class="align-center" src="_images/table_foreign_key.png" />
167<p>To add a foreign key constraint, select the <em>Foreign Key</em> tab, and click the
168<em>Add</em> icon (+). To define the constraint, click the <em>Edit</em> icon to the left of
169the <em>Trash</em> icon. A dialog similar to the <em>Foreign key</em> dialog (accessed by
170right clicking on <em>Constraints</em> in the <em>pgAdmin</em> tree control) opens.</p>
171<p>Use the fields in the <em>General</em> tab to identify the foreign key constraint:</p>
172<ul class="simple">
173<li><p>Use the <em>Name</em> field to add a descriptive name for the foreign key constraint.
174The name will be displayed in the <em>pgAdmin</em> tree control.</p></li>
175<li><p>Provide notes about the foreign key in the <em>Comment</em> field.</p></li>
176</ul>
177<p>Click the <em>Definition</em> tab to continue.</p>
178<img alt="Table dialog foreign key constraint definition" class="align-center" src="_images/foreign_key_definition.png" />
179<p>Use the fields in the <em>Definition</em> tab to define the foreign key constraint:</p>
180<ul>
181<li><p>Move the <em>Deferrable?</em> switch to the <em>Yes</em> position to specify the timing of
182the constraint is deferrable and can be postponed until the end of the
183statement. The default is <em>No</em>.</p></li>
184<li><p>If enabled, move the <em>Deferred?</em> switch to the <em>Yes</em> position to specify the
185timing of the constraint is deferred to the end of the statement. The default
186is <em>No</em>.</p></li>
187<li><p>Move the <em>Match type</em> switch specify the type of matching that is enforced by
188the constraint:</p>
189<blockquote>
190<div><ul class="simple">
191<li><p>Select <em>Full</em> to indicate that all columns of a multicolumn foreign key
192must be null if any column is null; if all columns are null, the row is
193not required to have a match in the referenced table.</p></li>
194<li><p>Select <em>Simple</em> to specify that a single foreign key column may be null;
195if any column is null, the row is not required to have a match in the
196referenced table.</p></li>
197</ul>
198</div></blockquote>
199</li>
200<li><p>Move the <em>Validated</em> switch to the <em>Yes</em> position to instruct the server to
201validate the existing table content (against a foreign key or check
202constraint) when you save modifications to this dialog.</p></li>
203<li><p>Move the <em>Auto FK Index</em> switch to the <em>No</em> position to disable the automatic
204index feature.</p></li>
205<li><p>The field next to <em>Covering Index</em> generates the name of an index if the <em>Auto
206FK Index</em> switch is in the <em>Yes</em> position; or, this field is disabled.</p></li>
207</ul>
208<p>Click the <em>Columns</em> tab to continue.</p>
209<img alt="Table dialog foreign key constraint columns" class="align-center" src="_images/foreign_key_columns.png" />
210<dl class="simple">
211<dt>Use the fields in the <em>Columns</em> tab to specify one or more reference column(s).</dt><dd><p>A Foreign Key constraint requires that one or more columns of a table must only
212contain values that match values in the referenced column(s) of a row of a
213referenced table:</p>
214</dd>
215</dl>
216<ul class="simple">
217<li><p>Use the drop-down listbox next to <em>Local column</em> to specify the column in the
218current table that will be compared to the foreign table.</p></li>
219<li><p>Use the drop-down listbox next to <em>References</em> to specify the name of the
220table in which the comparison column(s) resides.</p></li>
221<li><p>Use the drop-down listbox next to <em>Referencing</em> to specify a column in the
222foreign table.</p></li>
223</ul>
224<p>Click the <em>Add</em> icon (+) to add a column to the list; repeat the steps above and
225click the <em>Add</em> icon (+) to add additional columns. To discard an entry, click
226the trash icon to the left of the entry and confirm deletion in the <em>Delete Row</em>
227popup.</p>
228<p>Click the <em>Action</em> tab to continue.</p>
229<img alt="Table dialog foreign key constraint action" class="align-center" src="_images/foreign_key_action.png" />
230<p>Use the drop-down listboxes on the <em>Action</em> tab to specify behavior related to
231the foreign key constraint that will be performed when data within the table is
232updated or deleted:</p>
233<ul class="simple">
234<li><p>Use the drop-down listbox next to <em>On update</em> to select an action that will be
235performed when data in the table is updated.</p></li>
236<li><p>Use the drop-down listbox next to <em>On delete</em> to select an action that will be
237performed when data in the table is deleted.</p></li>
238</ul>
239<p>The supported actions are:</p>
240<table class="longtable docutils align-default">
241<colgroup>
242<col style="width: 20.0%" />
243<col style="width: 80.0%" />
244</colgroup>
245<tbody>
246<tr class="row-odd"><td><p>NO ACTION</p></td>
247<td><p>Produce an error indicating that the deletion or update will create a foreign key constraint violation.
248If the constraint is deferred, this error will be produced at constraint check time if any referencing
249rows still exist.  This is the default.</p></td>
250</tr>
251<tr class="row-even"><td><p>RESTRICT</p></td>
252<td><p>Throw an error indicating that the deletion or update would create a foreign key constraint violation.
253This is the same as NO ACTION except that the check is not deferrable.</p></td>
254</tr>
255<tr class="row-odd"><td><p>CASCADE</p></td>
256<td><p>Delete any rows referencing the deleted row, or update the values of the referencing column(s) to the new
257values of the referenced columns, respectively.</p></td>
258</tr>
259<tr class="row-even"><td><p>SET NULL</p></td>
260<td><p>Set the referencing column(s) to null.</p></td>
261</tr>
262<tr class="row-odd"><td><p>SET DEFAULT</p></td>
263<td><p>Set the referencing column(s) to their default values.  There must be a row in the referenced table
264that matches the default values (if they are not null), or the operation will fail.</p></td>
265</tr>
266</tbody>
267</table>
268<img alt="Table dialog check constraint" class="align-center" src="_images/table_check.png" />
269<p>To add a check constraint, select the <em>Check</em> tab on the panel, and click the
270<em>Add</em> icon (+). To define the check constraint, click the <em>Edit</em> icon to the
271left of the <em>Trash</em> icon. A dialog similar to the <em>Check</em> dialog (accessed by
272right clicking on <em>Constraints</em> in the <em>pgAdmin</em> tree control) opens.</p>
273<p>Use the fields in the <em>General</em> tab to identify the check constraint:</p>
274<ul class="simple">
275<li><p>Use the <em>Name</em> field to add a descriptive name for the check constraint. The
276name will be displayed in the <em>pgAdmin</em> tree control. With PostgreSQL 9.5
277forward, when a table has multiple check constraints, they will be tested for
278each row in alphabetical order by name and after NOT NULL constraints.</p></li>
279<li><p>Provide notes about the check constraint in the <em>Comment</em> field.</p></li>
280</ul>
281<p>Click the <em>Definition</em> tab to continue.</p>
282<img alt="Table dialog check constraint definition" class="align-center" src="_images/check_definition.png" />
283<p>Use the fields in the <em>Definition</em> tab to define the check constraint:</p>
284<ul class="simple">
285<li><p>Provide the expression that a row must satisfy in the <em>Check</em> field. This
286field is required.</p></li>
287<li><p>Move the <em>No Inherit?</em> switch to the <em>Yes</em> position to specify that this
288constraint is not automatically inherited by a table’s children. The default
289is <em>No</em>, meaning that the constraint will be inherited by any children.</p></li>
290<li><p>Move the <em>Don’t validate?</em> switch to the <em>No</em> position to skip validation of
291existing data; the constraint may not hold for all rows in the table. The
292default is <em>Yes</em>.</p></li>
293</ul>
294<img alt="Table dialog unique constraint" class="align-center" src="_images/table_unique.png" />
295<p>To add a unique constraint, select the <em>Unique</em> tab on the panel, and click the
296<em>Add</em> icon (+). To define the constraint, click the <em>Edit</em> icon to the left of
297the <em>Trash</em> icon. A dialog similar to the <em>Unique constraint</em> dialog (accessed
298by right clicking on <em>Constraints</em> in the <em>pgAdmin</em> tree control) opens.</p>
299<p>Use the fields in the <em>General</em> tab to identify the unique constraint:</p>
300<ul class="simple">
301<li><p>Use the <em>Name</em> field to add a descriptive name for the unique constraint. The
302name will be displayed in the <em>pgAdmin</em> tree control.</p></li>
303<li><p>Provide notes about the unique constraint in the <em>Comment</em> field.</p></li>
304</ul>
305<p>Click the <em>Definition</em> tab to continue.</p>
306<img alt="Table dialog unique constraint definition" class="align-center" src="_images/unique_constraint_definition.png" />
307<p>Use the fields in the <em>Definition</em> tab to define the unique constraint:</p>
308<ul class="simple">
309<li><p>Click inside the <em>Columns</em> field and select one or more column names from the
310drop-down listbox. To delete a selection, click the <em>x</em> to the left of the
311column name. The unique constraint should be different from the primary key
312constraint defined for the same table; the selected column(s) for the
313constraints must be distinct.</p></li>
314<li><p>Select the name of the tablespace in which the unique constraint will reside
315from the drop-down listbox in the <em>Tablespace</em> field.</p></li>
316<li><p>Use the <em>Fill Factor</em> field to specify a fill factor for the table and index.
317The fill factor for a table is a percentage between 10 and 100. 100 (complete
318packing) is the default.</p></li>
319<li><p>Move the <em>Deferrable?</em> switch to the <em>Yes</em> position to specify the timing of
320the constraint is deferrable and can be postponed until the end of the
321statement. The default is <em>No</em>.</p></li>
322<li><p>If enabled, move the <em>Deferred?</em> switch to the <em>Yes</em> position to specify the
323timing of the constraint is deferred to the end of the statement. The default
324is <em>No</em>.</p></li>
325</ul>
326<img alt="Table dialog exclude constraint" class="align-center" src="_images/table_exclude.png" />
327<p>To add an exclusion constraint, select the <em>Exclude</em> tab on the panel, and click
328the <em>Add</em> icon (+). To define the constraint, click the <em>Edit</em> icon to the left
329of the <em>Trash</em> icon. A dialog similar to the <em>Exclusion constraint</em> dialog
330(accessed by right clicking on <em>Constraints</em> in the <em>pgAdmin</em> tree control)
331opens.</p>
332<p>Use the fields in the <em>General</em> tab to identify the exclusion constraint:</p>
333<ul class="simple">
334<li><p>Use the <em>Name</em> field to provide a descriptive name for the exclusion
335constraint. The name will be displayed in the <em>pgAdmin</em> tree control.</p></li>
336<li><p>Provide notes about the exclusion constraint in the <em>Comment</em> field.</p></li>
337</ul>
338<p>Click the <em>Definition</em> tab to continue.</p>
339<img alt="Table dialog exclusion constraint definition" class="align-center" src="_images/exclusion_constraint_definition.png" />
340<p>Use the fields in the <em>Definition</em> tab to define the exclusion constraint:</p>
341<ul>
342<li><p>Use the drop-down listbox next to <em>Tablespace</em> to select the tablespace in
343which the index associated with the exclude constraint will reside.</p></li>
344<li><p>Use the drop-down listbox next to <em>Access method</em> to specify the type of
345index that will be used when implementing the exclusion constraint:</p>
346<blockquote>
347<div><ul class="simple">
348<li><p>Select <em>gist</em> to specify a GiST index (the default).</p></li>
349<li><p>Select <em>spgist</em> to specify a space-partitioned GiST index.</p></li>
350<li><p>Select <em>btree</em> to specify a B-tree index.</p></li>
351<li><p>Select <em>hash</em> to specify a hash index.</p></li>
352</ul>
353</div></blockquote>
354</li>
355<li><p>Use the <em>Fill Factor</em> field to specify a fill factor for the table and
356associated index. The fill factor is a percentage between 10 and 100. 100
357(complete packing) is the default.</p></li>
358<li><p>Move the <em>Deferrable?</em> switch to the <em>Yes</em> position to specify that the timing
359of the constraint is deferrable, and can be postponed until the end of the
360statement. The default is <em>No</em>.</p></li>
361<li><p>If enabled, move the <em>Deferred?</em> switch to the <em>Yes</em> position to specify the
362timing of the constraint is deferred to the end of the statement. The default
363is <em>No</em>.</p></li>
364<li><p>Use the <em>Constraint</em> field to provide a condition that a row must satisfy to
365be included in the table.</p></li>
366</ul>
367<p>Click the <em>Columns</em> tab to continue.</p>
368<img alt="Table dialog exclusion constraint columns" class="align-center" src="_images/exclusion_constraint_columns.png" />
369<p>Use the fields in the <em>Columns</em> tab to specify the column(s) to which the
370constraint applies. Use the drop-down listbox next to <em>Column</em> to select a
371column and click the <em>Add</em> icon (+) to provide details of the action on the
372column:</p>
373<ul class="simple">
374<li><p>The <em>Column</em> field is populated with the selection made in the <em>Column</em>
375drop-down listbox.</p></li>
376<li><p>If applicable, use the drop-down listbox in the <em>Operator class</em> to specify
377the operator class that will be used by the index for the column.</p></li>
378<li><p>Move the <em>DESC</em> switch to <em>DESC</em> to specify a descending sort order. The
379default is <em>ASC</em> which specifies an ascending sort order.</p></li>
380<li><p>Move the <em>NULLs order</em> switch to <em>LAST</em> to define an ascending sort order for
381NULLs. The default is <em>FIRST</em> which specifies a descending order.</p></li>
382<li><p>Use the drop-down list next to <em>Operator</em> to specify a comparison or
383conditional operator.</p></li>
384</ul>
385<p>Click the <em>Advanced</em> tab to continue.</p>
386<img alt="Table dialog advanced tab" class="align-center" src="_images/table_advanced.png" />
387<p>Use the fields in the <em>Advanced</em> tab to define advanced features for the table:</p>
388<ul class="simple">
389<li><p>Move the <em>RLS Policy?</em> switch to the <em>Yes</em> position to enable the Row Level Security.</p></li>
390<li><p>Move the <em>Force RLS Policy?</em> to the <em>Yes</em> position to force the policy on the owner of the table.</p></li>
391<li><p>Use the drop-down listbox next to <em>Of type</em> to copy the table structure from
392the specified composite type. Please note that a typed table will be dropped
393if the type is dropped (with DROP TYPE … CASCADE).</p></li>
394<li><p>Use the drop-down list box next to Access Method to specify the table access method to use to store
395the contents for the new table; the method needs to be an access method of type TABLE. This field is optional.
396This option is available from v12 and above.</p></li>
397<li><p>Use the <em>Fill Factor</em> field to specify a fill factor for the table. The fill
398factor for a table is a percentage between 10 and 100. 100 (complete packing)
399is the default.</p></li>
400<li><p>Use the <em>Toast tuple target</em> field to set toast_tuple_target storage
401parameter of the table. The toast_tuple_target value is in bytes and has
402minimum value of 128. This field will be enabled only for
403PostgreSQL version &gt;= 11</p></li>
404<li><p>Use the <em>Parallel workers</em> field to set parallel_workers storage
405parameter of the table. The parallel_workers sets the number of workers that
406should be used to assist a parallel scan of the table. This field will be
407enabled only for PostgreSQL version &gt;= 9.6</p></li>
408<li><p>Move the <em>Has OIDs?</em> switch to the <em>Yes</em> position to specify that each row
409within a table has a system-assigned object identifier. The default is <em>No</em>.</p></li>
410<li><p>Move the <em>Unlogged?</em> switch to the <em>Yes</em> position to disable logging for the
411table. Data written to an unlogged table is not written to the write-ahead
412log. Any indexes created on an unlogged table are automatically unlogged as
413well. The default is <em>No</em>.</p></li>
414</ul>
415<p>Use the fields in the <strong>Like</strong> box to specify which attributes of an existing
416table from which a table will automatically copy column names, data types, and
417not-null constraints;  after saving the new or modified table, any changes to
418the original table will not be applied to the new table.</p>
419<ul class="simple">
420<li><p>Use the drop-down listbox next to <em>Relation</em> to select a reference table.</p></li>
421<li><p>Move the switch next to <em>With default values?</em> towards the <em>right position</em> to copy default
422values.</p></li>
423<li><p>Move the switch next to <em>With constraints?</em> towards the <em>right position</em> to copy table and
424column constraints.</p></li>
425<li><p>Move the switch next to <em>With indexes?</em> towards the <em>right position</em> to copy indexes.</p></li>
426<li><p>Move the switch next to <em>With storage?</em> towards the <em>right position</em> to copy storage settings.</p></li>
427<li><p>Move the switch next to <em>With comments?</em> towards the <em>right position</em> to copy comments.</p></li>
428<li><p>Move the switch next to <em>With compression?</em> towards the <em>right position</em> to copy
429compression method. This option is available only on PostgreSQL 14 and above.</p></li>
430<li><p>Move the switch next to <em>With generated?</em> towards the <em>right position</em> to copy
431generation expressions of copied column. This option is available only on PostgreSQL 12 and above.</p></li>
432<li><p>Move the switch next to <em>With identity?</em> towards the <em>right position</em> to copy
433any identity specifications of copied column.</p></li>
434<li><p>Move the switch next to <em>With statistics?</em> towards the <em>right position</em> to copy
435extended statistics.</p></li>
436</ul>
437<p>With PostgreSQL 10 forward, the <em>Partition</em> tab will be visible.</p>
438<p>Click the <em>Partition</em> tab to continue.</p>
439<img alt="Table dialog partition tab" class="align-center" src="_images/table_partition.png" />
440<p>Use the fields in the <em>partition</em> tab to create the partitions for the table:</p>
441<ul class="simple">
442<li><p>Select a partition type from the <em>Partition Type</em> selection box. There are 3
443options available; Range, List and Hash. Hash option will only enable for
444PostgreSQL version &gt;= 11.</p></li>
445</ul>
446<p>Use the <em>Partition Keys</em> panel to define the partition keys. Click the <em>Add</em>
447icon (+) to add each partition keys selection:</p>
448<ul class="simple">
449<li><p>Select a partition key type in the <em>Keytype</em> field.</p></li>
450<li><p>Select a partition column in the <em>Column</em> field if Column option selected for
451<em>Keytype</em> field .</p></li>
452<li><p>Specify the expression in the <em>Expression</em> field if Expression option selected
453for the <em>Keytype</em> field.</p></li>
454</ul>
455<p>Use the <em>Partitions</em> panel to define the partitions of a table. Click the <em>Add</em>
456icon (+) to add each partition:</p>
457<ul class="simple">
458<li><p>Move the <em>Operation</em> switch to <em>attach</em> to attach the partition, by default it
459is <em>create</em>.</p></li>
460<li><p>Use the <em>Name</em> field to add the name of the partition.</p></li>
461<li><p>If partition type is Range or List then <em>Default</em> field will be enabled.</p></li>
462<li><p>If partition type is Range then <em>From</em> and <em>To</em> fields will be enabled.</p></li>
463<li><p>If partition type is List then <em>In</em> field will be enabled.</p></li>
464<li><p>If partition type is Hash then <em>Modulus</em> and <em>Remainder</em> fields will be
465enabled.</p></li>
466</ul>
467<p>Users can create a partition and define them as a partitioned table. Click
468the <em>Edit</em> icon to expand the properties of a partition.
469Use the <em>Partition</em> tab to create that partition as a partitioned table.</p>
470<ul class="simple">
471<li><p>Move the <em>Partitioned Table?</em> switch to the <em>Yes</em> in case you want to create a
472partitioned table.</p></li>
473<li><p>Select a partition type from the <em>Partition Type</em> selection box.</p></li>
474<li><p>Use the <em>Partition Keys</em> panel to define the partition keys.</p></li>
475</ul>
476<p>View of multi level Partitioned Table in object explorer:</p>
477<img alt="Table dialog partition tree" class="align-center" src="_images/table_partition_tree.png" />
478<p>Click the <em>Parameter</em> tab to continue.</p>
479<img alt="Table dialog parameter tab" class="align-center" src="_images/table_parameter.png" />
480<p>Use the tabs nested inside the <em>Parameter</em> tab to specify VACUUM and ANALYZE
481thresholds; use the <em>Table</em> tab and the <em>Toast Table</em> tab to customize values
482for the table and the associated toast table:</p>
483<ul class="simple">
484<li><p>Move the <em>Custom auto-vacuum?</em> switch to the <em>Yes</em> position to perform custom
485maintenance on the table and to select values in the
486<em>Vacuum table</em>. The <em>Vacuum Table</em> provides default values for maintenance
487operations.</p></li>
488<li><p>Changing <em>Autovacuum enabled?</em> to <em>Not set</em> will reset autovacuum_enabled.</p></li>
489</ul>
490<p>Provide a custom value in the <em>Value</em> column for each metric listed in the
491<em>Label</em> column.</p>
492<p>Click the <em>Security</em> tab to continue.</p>
493<img alt="Table dialog security tab" class="align-center" src="_images/table_security.png" />
494<p>Use the <em>Security</em> tab to assign privileges and define security labels.</p>
495<p>Use the <em>Privileges</em> panel to assign privileges to a role. Click the <em>Add</em> icon
496(+) to set privileges for database objects:</p>
497<ul class="simple">
498<li><p>Select the name of the role from the drop-down listbox in the <em>Grantee</em> field.</p></li>
499<li><p>Click inside the <em>Privileges</em> field. Check the boxes to the left of one or
500more privileges to grant the selected privilege to the specified user.</p></li>
501<li><p>The current user, who is the default grantor for granting the privilege, is displayed in the <em>Grantor</em> field.</p></li>
502</ul>
503<p>Click the <em>Add</em> icon (+) to assign additional privileges; to discard a
504privilege, click the trash icon to the left of the row and confirm deletion in
505the <em>Delete Row</em> popup.</p>
506<p>Use the <em>Security Labels</em> panel to define security labels applied to the
507function. Click the <em>Add</em> icon (+) to add each security label selection:</p>
508<ul class="simple">
509<li><p>Specify a security label provider in the <em>Provider</em> field. The named provider
510must be loaded and must consent to the proposed labeling operation.</p></li>
511<li><p>Specify a a security label in the <em>Security Label</em> field. The meaning of a
512given label is at the discretion of the label provider. PostgreSQL places no
513restrictions on whether or how a label provider must interpret security
514labels; it merely provides a mechanism for storing them.</p></li>
515</ul>
516<p>Click the <em>Add</em> icon (+) to assign additional security labels; to discard a
517security label, click the trash icon to the left of the row and confirm deletion
518in the <em>Delete Row</em> popup.</p>
519<p>Click the <em>SQL</em> tab to continue.</p>
520<p>Your entries in the <em>Table</em> dialog generate a SQL command (see an example
521below). Use the <em>SQL</em> tab for review; revisit or switch tabs to make any
522changes to the SQL command.</p>
523<section id="example">
524<h2>Example<a class="headerlink" href="#example" title="Link to this heading">¶</a></h2>
525<p>The following is an example of the sql command generated by user selections in
526the <em>Table</em> dialog:</p>
527<img alt="Table dialog sql tab" class="align-center" src="_images/table_sql.png" />
528<p>The example shown demonstrates creating a table named <em>jobhist</em>. It has
529six columns and a primary key constraint on the <em>empno and startdate</em> column.</p>
530<ul class="simple">
531<li><p>Click the <em>Info</em> button (i) to access online help.</p></li>
532<li><p>Click the <em>Save</em> button to save work.</p></li>
533<li><p>Click the <em>Close</em> button to exit without saving work.</p></li>
534<li><p>Click the <em>Reset</em> button to restore configuration parameters.</p></li>
535</ul>
536</section>
537</section>
538
539
540            <div class="clearer"></div>
541          </div>
542        </div>
543      </div>
544      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
545        <div class="sphinxsidebarwrapper">
546  <div>
547    <h3><a href="index.html">Table of Contents</a></h3>
548    <ul>
549<li><a class="reference internal" href="#">Table Dialog</a><ul>
550<li><a class="reference internal" href="#example">Example</a></li>
551</ul>
552</li>
553</ul>
554
555  </div>
556<h3><a href="index.html">Table of Contents</a></h3>
557<ul class="current">
558<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
559<li class="toctree-l1"><a class="reference internal" href="external_database.html">External database for pgAdmin user settings</a></li>
560<li class="toctree-l1"><a class="reference internal" href="connecting.html">Connecting To A Server</a></li>
561<li class="toctree-l1"><a class="reference internal" href="managing_cluster_objects.html">Managing Cluster Objects</a></li>
562<li class="toctree-l1"><a class="reference internal" href="managing_database_objects.html">Managing Database Objects</a></li>
563<li class="toctree-l1 current"><a class="reference internal" href="modifying_tables.html">Creating or Modifying a Table</a><ul class="current">
564<li class="toctree-l2"><a class="reference internal" href="check_dialog.html">Check Dialog</a></li>
565<li class="toctree-l2"><a class="reference internal" href="column_dialog.html">Column Dialog</a></li>
566<li class="toctree-l2"><a class="reference internal" href="compound_trigger_dialog.html">Compound Trigger Dialog</a></li>
567<li class="toctree-l2"><a class="reference internal" href="exclusion_constraint_dialog.html">Exclusion Constraint Dialog</a></li>
568<li class="toctree-l2"><a class="reference internal" href="foreign_key_dialog.html">Foreign key Dialog</a></li>
569<li class="toctree-l2"><a class="reference internal" href="index_dialog.html">Index Dialog</a></li>
570<li class="toctree-l2"><a class="reference internal" href="primary_key_dialog.html">Primary key Dialog</a></li>
571<li class="toctree-l2"><a class="reference internal" href="rls_policy_dialog.html">RLS Policy Dialog</a></li>
572<li class="toctree-l2"><a class="reference internal" href="rule_dialog.html">Rule Dialog</a></li>
573<li class="toctree-l2 current"><a class="current reference internal" href="#">Table Dialog</a></li>
574<li class="toctree-l2"><a class="reference internal" href="trigger_dialog.html">Trigger Dialog</a></li>
575<li class="toctree-l2"><a class="reference internal" href="unique_constraint_dialog.html">Unique Constraint Dialog</a></li>
576</ul>
577</li>
578<li class="toctree-l1"><a class="reference internal" href="management_basics.html">Management Basics</a></li>
579<li class="toctree-l1"><a class="reference internal" href="backup_and_restore.html">Backup and Restore</a></li>
580<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
581<li class="toctree-l1"><a class="reference internal" href="processes.html">Processes</a></li>
582<li class="toctree-l1"><a class="reference internal" href="pgagent.html">pgAgent</a></li>
583<li class="toctree-l1"><a class="reference internal" href="contributions.html">pgAdmin Project Contributions</a></li>
584<li class="toctree-l1"><a class="reference internal" href="release_notes.html">Release Notes</a></li>
585<li class="toctree-l1"><a class="reference internal" href="licence.html">Licence</a></li>
586</ul>
587
588<search id="searchbox" style="display: none" role="search">
589  <h3 id="searchlabel">Quick search</h3>
590    <div class="searchformwrapper">
591    <form class="search" action="search.html" method="get">
592      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
593      <input type="submit" value="Go" />
594    </form>
595    </div>
596</search>
597<script>document.getElementById('searchbox').style.display = "block"</script>
598        </div>
599<div id="sidebarbutton" title="Collapse sidebar">
600<span>«</span>
601</div>
602
603      </div>
604      <div class="clearer"></div>
605    </div>
606    <div class="related" role="navigation" aria-label="related navigation">
607      <h3>Navigation</h3>
608      <ul>
609        <li class="right" style="margin-right: 10px">
610          <a href="genindex.html" title="General Index"
611             >index</a></li>
612        <li class="right" >
613          <a href="trigger_dialog.html" title="Trigger Dialog"
614             >next</a> |</li>
615        <li class="right" >
616          <a href="rule_dialog.html" title="Rule Dialog"
617             >previous</a> |</li>
618        <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> &#187;</li>
619          <li class="nav-item nav-item-1"><a href="modifying_tables.html" >Creating or Modifying a Table</a> &#187;</li>
620        <li class="nav-item nav-item-this"><a href="">Table Dialog</a></li> 
621      </ul>
622    </div>
623    <div class="footer" role="contentinfo">
624        <div class="related" role="navigation" aria-label="related navigation">
625          <ul>
626              <li class="left" style="margin-left: 10px">&#169; Copyright (C) 2013 - 2024, The pgAdmin Development Team.</li>
627            <li class="right" style="margin-right: 10px"><a href="genindex.html" title="General Index" accesskey="I">index</a></li>
628            <li class="right" ><a href="trigger_dialog.html" title="Trigger Dialog" accesskey="N">next</a> |</li>
629            <li class="right" ><a href="rule_dialog.html" title="Rule Dialog" accesskey="P">previous</a> |</li>
630          </ul>
631        </div>
632    </div>
633  </body>
634</html>
codekingpro/portable-devtools · Team Ai