4 The view attributes contains information about the attributes of
5 composite data types defined in the database. (Note that the view does
6 not give information about table columns, which are sometimes called
7 attributes in PostgreSQL contexts.) Only those attributes are shown
8 that the current user has access to (by way of being the owner of or
9 having some privilege on the type).
11 Table 35.4. attributes Columns
17 udt_catalog sql_identifier
19 Name of the database containing the data type (always the current
22 udt_schema sql_identifier
24 Name of the schema containing the data type
26 udt_name sql_identifier
30 attribute_name sql_identifier
34 ordinal_position cardinal_number
36 Ordinal position of the attribute within the data type (count starts at
39 attribute_default character_data
41 Default expression of the attribute
45 YES if the attribute is possibly nullable, NO if it is known not
48 data_type character_data
50 Data type of the attribute, if it is a built-in type, or ARRAY if it is
51 some array (in that case, see the view element_types), else
52 USER-DEFINED (in that case, the type is identified in
53 attribute_udt_name and associated columns).
55 character_maximum_length cardinal_number
57 If data_type identifies a character or bit string type, the declared
58 maximum length; null for all other data types or if no maximum length
61 character_octet_length cardinal_number
63 If data_type identifies a character type, the maximum possible length
64 in octets (bytes) of a datum; null for all other data types. The
65 maximum octet length depends on the declared character maximum length
66 (see above) and the server encoding.
68 character_set_catalog sql_identifier
70 Applies to a feature not available in PostgreSQL
72 character_set_schema sql_identifier
74 Applies to a feature not available in PostgreSQL
76 character_set_name sql_identifier
78 Applies to a feature not available in PostgreSQL
80 collation_catalog sql_identifier
82 Name of the database containing the collation of the attribute (always
83 the current database), null if default or the data type of the
84 attribute is not collatable
86 collation_schema sql_identifier
88 Name of the schema containing the collation of the attribute, null if
89 default or the data type of the attribute is not collatable
91 collation_name sql_identifier
93 Name of the collation of the attribute, null if default or the data
94 type of the attribute is not collatable
96 numeric_precision cardinal_number
98 If data_type identifies a numeric type, this column contains the
99 (declared or implicit) precision of the type for this attribute. The
100 precision indicates the number of significant digits. It can be
101 expressed in decimal (base 10) or binary (base 2) terms, as specified
102 in the column numeric_precision_radix. For all other data types, this
105 numeric_precision_radix cardinal_number
107 If data_type identifies a numeric type, this column indicates in which
108 base the values in the columns numeric_precision and numeric_scale are
109 expressed. The value is either 2 or 10. For all other data types, this
112 numeric_scale cardinal_number
114 If data_type identifies an exact numeric type, this column contains the
115 (declared or implicit) scale of the type for this attribute. The scale
116 indicates the number of significant digits to the right of the decimal
117 point. It can be expressed in decimal (base 10) or binary (base 2)
118 terms, as specified in the column numeric_precision_radix. For all
119 other data types, this column is null.
121 datetime_precision cardinal_number
123 If data_type identifies a date, time, timestamp, or interval type, this
124 column contains the (declared or implicit) fractional seconds precision
125 of the type for this attribute, that is, the number of decimal digits
126 maintained following the decimal point in the seconds value. For all
127 other data types, this column is null.
129 interval_type character_data
131 If data_type identifies an interval type, this column contains the
132 specification which fields the intervals include for this attribute,
133 e.g., YEAR TO MONTH, DAY TO SECOND, etc. If no field restrictions were
134 specified (that is, the interval accepts all fields), and for all other
135 data types, this field is null.
137 interval_precision cardinal_number
139 Applies to a feature not available in PostgreSQL (see
140 datetime_precision for the fractional seconds precision of interval
143 attribute_udt_catalog sql_identifier
145 Name of the database that the attribute data type is defined in (always
146 the current database)
148 attribute_udt_schema sql_identifier
150 Name of the schema that the attribute data type is defined in
152 attribute_udt_name sql_identifier
154 Name of the attribute data type
156 scope_catalog sql_identifier
158 Applies to a feature not available in PostgreSQL
160 scope_schema sql_identifier
162 Applies to a feature not available in PostgreSQL
164 scope_name sql_identifier
166 Applies to a feature not available in PostgreSQL
168 maximum_cardinality cardinal_number
170 Always null, because arrays always have unlimited maximum cardinality
173 dtd_identifier sql_identifier
175 An identifier of the data type descriptor of the attribute, unique
176 among the data type descriptors pertaining to the composite type. This
177 is mainly useful for joining with other instances of such identifiers.
178 (The specific format of the identifier is not defined and not
179 guaranteed to remain the same in future versions.)
181 is_derived_reference_attribute yes_or_no
183 Applies to a feature not available in PostgreSQL
185 See also under Section 35.17, a similarly structured view, for further
186 information on some of the columns.