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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>42.6.pg_attrdef</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="catalogs.html" title="Chapter42.System Catalogs">
<link rel="prev" href="catalog-pg-amproc.html" title="42.5.pg_amproc">
<link rel="next" href="catalog-pg-attribute.html" title="42.7.pg_attribute">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="catalog-pg-attrdef"></a>42.6.<code class="structname">pg_attrdef</code></h2></div></div></div>
<a name="id821984"></a><p> The catalog <code class="structname">pg_attrdef</code> stores column default values. The main information
about columns is stored in <code class="structname">pg_attribute</code>
(see below). Only columns that explicitly specify a default value
(when the table is created or the column is added) will have an
entry here.
</p>
<div class="table">
<a name="id822010"></a><p class="title"><b>Table42.6.<code class="structname">pg_attrdef</code> Columns</b></p>
<div class="table-contents"><table summary="pg_attrdef Columns" border="1">
<colgroup>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>References</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code class="structfield">adrelid</code></td>
<td><code class="type">oid</code></td>
<td><code class="literal"><a href="catalog-pg-class.html" title="42.12.pg_class"><code class="structname">pg_class</code></a>.oid</code></td>
<td>The table this column belongs to</td>
</tr>
<tr>
<td><code class="structfield">adnum</code></td>
<td><code class="type">int2</code></td>
<td><code class="literal"><a href="catalog-pg-attribute.html" title="42.7.pg_attribute"><code class="structname">pg_attribute</code></a>.attnum</code></td>
<td>The number of the column</td>
</tr>
<tr>
<td><code class="structfield">adbin</code></td>
<td><code class="type">text</code></td>
<td></td>
<td>The internal representation of the column default value</td>
</tr>
<tr>
<td><code class="structfield">adsrc</code></td>
<td><code class="type">text</code></td>
<td></td>
<td>A human-readable representation of the default value</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p> The <code class="structfield">adsrc</code> field is historical, and is best
not used, because it does not track outside changes that might affect
the representation of the default value. Reverse-compiling the
<code class="structfield">adbin</code> field (with <code class="function">pg_get_expr</code> for
example) is a better way to display the default value.
</p>
</div></body>
</html>
|