77 *
88 * Copyright (c) 1994, Regents of the University of California
99 *
10- * $Id: pg_attribute.h,v 1.47 1999/05/25 16:13:42 momjian Exp $
10+ * $Id: pg_attribute.h,v 1.48 1999/07/31 19:07:25 tgl Exp $
1111 *
1212 * NOTES
1313 * the genbki.sh script reads this file and generates .bki
4040 */
4141CATALOG (pg_attribute )BOOTSTRAP
4242{
43- Oid attrelid ;
43+ Oid attrelid ;/* OID of relation containing this attribute */
4444NameData attname ;
4545Oid atttypid ;
46-
4746/*
4847 * atttypid is the OID of the instance in Catalog Class pg_type that
4948 * defines the data type of this attribute (e.g. int4). Information
5049 * in that instance is redundant with the attlen, attbyval, and
5150 * attalign attributes of this instance, so they had better match or
5251 * Postgres will fail.
5352 */
53+
5454float4 attdisbursion ;
55- int2 attlen ;
55+ /*
56+ * attdisbursion is the disbursion statistic of the column, or zero if
57+ * the statistic has not been calculated.
58+ */
5659
60+ int2 attlen ;
5761/*
5862 * attlen is a copy of the typlen field from pg_type for this
5963 * attribute. See atttypid above.See struct Form_pg_type for
6064 * definition.
6165 */
62- int2 attnum ;
6366
67+ int2 attnum ;
6468/*
6569 * attnum is the "attribute number" for the attribute:A value that
6670 * uniquely identifies this attribute within its class. For user
@@ -74,46 +78,43 @@ CATALOG(pg_attribute) BOOTSTRAP
7478 *
7579 * Note that (attnum - 1) is often used as the index to an array.
7680 */
77- int4 attnelems ;
7881
79- int4 attcacheoff ;
82+ int4 attnelems ; /* number of dimensions, if an array type */
8083
84+ int4 attcacheoff ;
8185/*
8286 * fastgetattr() uses attcacheoff to cache byte offsets of attributes
83- * in heap tuples.Thedata actually stored in pg_attribute (-1)
87+ * in heap tuples.Thevalue actually stored in pg_attribute (-1)
8488 * indicates no cached value. But when we copy these tuples into a
8589 * tuple descriptor, we may then update attcacheoff in the copies.
8690 * This speeds up the attribute walking process.
8791 */
8892
8993int4 atttypmod ;
90-
9194/*
92- * atttypmod records type-specific modifications supplied at table
93- * creation time, and passes it to input and output functions as the
94- * third argument.
95+ * atttypmod records type-specific data supplied at table creation time
96+ * (for example, the max length of a varchar field). It is passed to
97+ * type-specific input and output functions as the third argument.
98+ * The value will generally be -1 for types that do not need typmod.
9599 */
96100
97101bool attbyval ;
98-
99102/*
100103 * attbyval is a copy of the typbyval field from pg_type for this
101104 * attribute. See atttypid above.See struct Form_pg_type for
102105 * definition.
103106 */
104107bool attisset ;
105108char attalign ;
106-
107109/*
108110 * attalign is a copy of the typalign field from pg_type for this
109111 * attribute. See atttypid above.See struct Form_pg_type for
110112 * definition.
111113 */
112- bool attnotnull ;
113114
115+ bool attnotnull ;
114116/* This flag represents the "NOT NULL" constraint */
115117bool atthasdef ;
116-
117118/* Has DEFAULT value or not */
118119}FormData_pg_attribute ;
119120