]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/infoschema-attributes.html
WIP: toc builder
[ai-pg] / full-docs / src / sgml / html / infoschema-attributes.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>35.6. attributes</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="infoschema-applicable-roles.html" title="35.5. applicable_roles" /><link rel="next" href="infoschema-character-sets.html" title="35.7. character_sets" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">35.6. <code class="literal">attributes</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="infoschema-applicable-roles.html" title="35.5. applicable_roles">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="information-schema.html" title="Chapter 35. The Information Schema">Up</a></td><th width="60%" align="center">Chapter 35. The Information Schema</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="infoschema-character-sets.html" title="35.7. character_sets">Next</a></td></tr></table><hr /></div><div class="sect1" id="INFOSCHEMA-ATTRIBUTES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">35.6. <code class="literal">attributes</code> <a href="#INFOSCHEMA-ATTRIBUTES" class="id_link">#</a></h2></div></div></div><p>
3    The view <code class="literal">attributes</code> contains information about
4    the attributes of composite data types defined in the database.
5    (Note that the view does not give information about table columns,
6    which are sometimes called attributes in PostgreSQL contexts.)
7    Only those attributes are shown that the current user has access to (by way
8    of being the owner of or having some privilege on the type).
9   </p><div class="table" id="id-1.7.6.10.3"><p class="title"><strong>Table 35.4. <code class="structname">attributes</code> Columns</strong></p><div class="table-contents"><table class="table" summary="attributes Columns" border="1"><colgroup><col /></colgroup><thead><tr><th class="catalog_table_entry"><p class="column_definition">
10        Column Type
11       </p>
12       <p>
13        Description
14       </p></th></tr></thead><tbody><tr><td class="catalog_table_entry"><p class="column_definition">
15        <code class="structfield">udt_catalog</code> <code class="type">sql_identifier</code>
16       </p>
17       <p>
18        Name of the database containing the data type (always the current database)
19       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
20        <code class="structfield">udt_schema</code> <code class="type">sql_identifier</code>
21       </p>
22       <p>
23        Name of the schema containing the data type
24       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
25        <code class="structfield">udt_name</code> <code class="type">sql_identifier</code>
26       </p>
27       <p>
28        Name of the data type
29       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
30        <code class="structfield">attribute_name</code> <code class="type">sql_identifier</code>
31       </p>
32       <p>
33        Name of the attribute
34       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
35        <code class="structfield">ordinal_position</code> <code class="type">cardinal_number</code>
36       </p>
37       <p>
38        Ordinal position of the attribute within the data type (count starts at 1)
39       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
40        <code class="structfield">attribute_default</code> <code class="type">character_data</code>
41       </p>
42       <p>
43        Default expression of the attribute
44       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
45        <code class="structfield">is_nullable</code> <code class="type">yes_or_no</code>
46       </p>
47       <p>
48        <code class="literal">YES</code> if the attribute is possibly nullable,
49        <code class="literal">NO</code> if it is known not nullable.
50       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
51        <code class="structfield">data_type</code> <code class="type">character_data</code>
52       </p>
53       <p>
54        Data type of the attribute, if it is a built-in type, or
55        <code class="literal">ARRAY</code> if it is some array (in that case, see
56        the view <code class="literal">element_types</code>), else
57        <code class="literal">USER-DEFINED</code> (in that case, the type is
58        identified in <code class="literal">attribute_udt_name</code> and
59        associated columns).
60       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
61        <code class="structfield">character_maximum_length</code> <code class="type">cardinal_number</code>
62       </p>
63       <p>
64        If <code class="literal">data_type</code> identifies a character or bit
65        string type, the declared maximum length; null for all other
66        data types or if no maximum length was declared.
67       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
68        <code class="structfield">character_octet_length</code> <code class="type">cardinal_number</code>
69       </p>
70       <p>
71        If <code class="literal">data_type</code> identifies a character type,
72        the maximum possible length in octets (bytes) of a datum; null
73        for all other data types.  The maximum octet length depends on
74        the declared character maximum length (see above) and the
75        server encoding.
76       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
77        <code class="structfield">character_set_catalog</code> <code class="type">sql_identifier</code>
78       </p>
79       <p>
80        Applies to a feature not available in <span class="productname">PostgreSQL</span>
81       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
82        <code class="structfield">character_set_schema</code> <code class="type">sql_identifier</code>
83       </p>
84       <p>
85        Applies to a feature not available in <span class="productname">PostgreSQL</span>
86       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
87        <code class="structfield">character_set_name</code> <code class="type">sql_identifier</code>
88       </p>
89       <p>
90        Applies to a feature not available in <span class="productname">PostgreSQL</span>
91       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
92        <code class="structfield">collation_catalog</code> <code class="type">sql_identifier</code>
93       </p>
94       <p>
95        Name of the database containing the collation of the attribute
96        (always the current database), null if default or the data type
97        of the attribute is not collatable
98       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
99        <code class="structfield">collation_schema</code> <code class="type">sql_identifier</code>
100       </p>
101       <p>
102        Name of the schema containing the collation of the attribute,
103        null if default or the data type of the attribute is not
104        collatable
105       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
106        <code class="structfield">collation_name</code> <code class="type">sql_identifier</code>
107       </p>
108       <p>
109        Name of the collation of the attribute, null if default or the
110        data type of the attribute is not collatable
111       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
112        <code class="structfield">numeric_precision</code> <code class="type">cardinal_number</code>
113       </p>
114       <p>
115        If <code class="literal">data_type</code> identifies a numeric type, this
116        column contains the (declared or implicit) precision of the
117        type for this attribute.  The precision indicates the number of
118        significant digits.  It can be expressed in decimal (base 10)
119        or binary (base 2) terms, as specified in the column
120        <code class="literal">numeric_precision_radix</code>.  For all other data
121        types, this column is null.
122       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
123        <code class="structfield">numeric_precision_radix</code> <code class="type">cardinal_number</code>
124       </p>
125       <p>
126        If <code class="literal">data_type</code> identifies a numeric type, this
127        column indicates in which base the values in the columns
128        <code class="literal">numeric_precision</code> and
129        <code class="literal">numeric_scale</code> are expressed.  The value is
130        either 2 or 10.  For all other data types, this column is null.
131       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
132        <code class="structfield">numeric_scale</code> <code class="type">cardinal_number</code>
133       </p>
134       <p>
135        If <code class="literal">data_type</code> identifies an exact numeric
136        type, this column contains the (declared or implicit) scale of
137        the type for this attribute.  The scale indicates the number of
138        significant digits to the right of the decimal point.  It can
139        be expressed in decimal (base 10) or binary (base 2) terms, as
140        specified in the column
141        <code class="literal">numeric_precision_radix</code>.  For all other data
142        types, this column is null.
143       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
144        <code class="structfield">datetime_precision</code> <code class="type">cardinal_number</code>
145       </p>
146       <p>
147        If <code class="literal">data_type</code> identifies a date, time,
148        timestamp, or interval type, this column contains the (declared
149        or implicit) fractional seconds precision of the type for this
150        attribute, that is, the number of decimal digits maintained
151        following the decimal point in the seconds value.  For all
152        other data types, this column is null.
153       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
154        <code class="structfield">interval_type</code> <code class="type">character_data</code>
155       </p>
156       <p>
157        If <code class="literal">data_type</code> identifies an interval type,
158        this column contains the specification which fields the
159        intervals include for this attribute, e.g., <code class="literal">YEAR TO
160        MONTH</code>, <code class="literal">DAY TO SECOND</code>, etc.  If no
161        field restrictions were specified (that is, the interval
162        accepts all fields), and for all other data types, this field
163        is null.
164       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
165        <code class="structfield">interval_precision</code> <code class="type">cardinal_number</code>
166       </p>
167       <p>
168        Applies to a feature not available
169        in <span class="productname">PostgreSQL</span>
170        (see <code class="literal">datetime_precision</code> for the fractional
171        seconds precision of interval type attributes)
172       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
173        <code class="structfield">attribute_udt_catalog</code> <code class="type">sql_identifier</code>
174       </p>
175       <p>
176        Name of the database that the attribute data type is defined in
177        (always the current database)
178       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
179        <code class="structfield">attribute_udt_schema</code> <code class="type">sql_identifier</code>
180       </p>
181       <p>
182        Name of the schema that the attribute data type is defined in
183       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
184        <code class="structfield">attribute_udt_name</code> <code class="type">sql_identifier</code>
185       </p>
186       <p>
187        Name of the attribute data type
188       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
189        <code class="structfield">scope_catalog</code> <code class="type">sql_identifier</code>
190       </p>
191       <p>
192        Applies to a feature not available in <span class="productname">PostgreSQL</span>
193       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
194        <code class="structfield">scope_schema</code> <code class="type">sql_identifier</code>
195       </p>
196       <p>
197        Applies to a feature not available in <span class="productname">PostgreSQL</span>
198       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
199        <code class="structfield">scope_name</code> <code class="type">sql_identifier</code>
200       </p>
201       <p>
202        Applies to a feature not available in <span class="productname">PostgreSQL</span>
203       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
204        <code class="structfield">maximum_cardinality</code> <code class="type">cardinal_number</code>
205       </p>
206       <p>
207        Always null, because arrays always have unlimited maximum cardinality in <span class="productname">PostgreSQL</span>
208       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
209        <code class="structfield">dtd_identifier</code> <code class="type">sql_identifier</code>
210       </p>
211       <p>
212        An identifier of the data type descriptor of the attribute, unique
213        among the data type descriptors pertaining to the composite type.  This
214        is mainly useful for joining with other instances of such
215        identifiers.  (The specific format of the identifier is not
216        defined and not guaranteed to remain the same in future
217        versions.)
218       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
219        <code class="structfield">is_derived_reference_attribute</code> <code class="type">yes_or_no</code>
220       </p>
221       <p>
222        Applies to a feature not available in <span class="productname">PostgreSQL</span>
223       </p></td></tr></tbody></table></div></div><br class="table-break" /><p>
224    See also under <a class="xref" href="infoschema-columns.html" title="35.17. columns">Section 35.17</a>, a similarly
225    structured view, for further information on some of the columns.
226   </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="infoschema-applicable-roles.html" title="35.5. applicable_roles">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="information-schema.html" title="Chapter 35. The Information Schema">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="infoschema-character-sets.html" title="35.7. character_sets">Next</a></td></tr><tr><td width="40%" align="left" valign="top">35.5. <code class="literal">applicable_roles</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 35.7. <code class="literal">character_sets</code></td></tr></table></div></body></html>