このページを編集する際は、編集に関する方針に従ってください。

概要

変数名説明
attrelidこの属性を持つオブジェクトのオブジェクトID
attname属性名(システム識別子
atttypid
attstattarget
attlen
attnum
attndims
attcacheoff
atttypmod
attbyval
attstorage
attalign
attnotnull
atthasdef
attisdropped
attislocal
attinhcount
* pg_attribute definition.  cpp turns this into
* typedef struct FormData_pg_attribute
*
* If you change the following, make sure you change the structs for
* system attributes in catalog/heap.c also.

実装

  1. attrelidを、Oidとして定義。
  2. attnameを、NameDataとして定義。
  3. atttypidを、Oidとして定義。
  4. attstattargetを、int4として定義。
  5. attlenを、int2として定義。
  6. attnumを、int2として定義。
  7. attndimsを、int4として定義。
  8. attcacheoffを、int4として定義。
  9. atttypmodを、int4として定義。
  10. attbyvalを、boolとして定義。
  11. attstorageを、charとして定義。
  12. attalignを、charとして定義。
  13. attnotnullを、boolとして定義。
  14. atthasdefを、boolとして定義。
  15. attisdroppedを、boolとして定義。
  16. attislocalを、boolとして定義。
  17. attinhcountを、int4として定義。

CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS {

	Oid			attrelid;		/* OID of relation containing this attribute */
	NameData	attname;		/* name of attribute */
	/*
	 * atttypid is the OID of the instance in Catalog Class pg_type that
	 * defines the data type of this attribute (e.g. int4).  Information in
	 * that instance is redundant with the attlen, attbyval, and attalign
	 * attributes of this instance, so they had better match or Postgres will
	 * fail.
	 */
	Oid			atttypid;
	/*
	 * attstattarget is the target number of statistics datapoints to collect
	 * during VACUUM ANALYZE of this column.  A zero here indicates that we do
	 * not wish to collect any stats about this column. A "-1" here indicates
	 * that no value has been explicitly set for this column, so ANALYZE
	 * should use the default setting.
	 */
	int4		attstattarget;
	/*
	 * attlen is a copy of the typlen field from pg_type for this attribute.
	 * See atttypid comments above.
	 */
	int2		attlen;
	/*
	 * attnum is the "attribute number" for the attribute:	A value that
	 * uniquely identifies this attribute within its class. For user
	 * attributes, Attribute numbers are greater than 0 and not greater than
	 * the number of attributes in the class. I.e. if the Class pg_class says
	 * that Class XYZ has 10 attributes, then the user attribute numbers in
	 * Class pg_attribute must be 1-10.
	 *
	 * System attributes have attribute numbers less than 0 that are unique
	 * within the class, but not constrained to any particular range.
	 *
	 * Note that (attnum - 1) is often used as the index to an array.
	 */
	int2		attnum;
	/*
	 * attndims is the declared number of dimensions, if an array type,
	 * otherwise zero.
	 */
	int4		attndims;
	/*
	 * fastgetattr() uses attcacheoff to cache byte offsets of attributes in
	 * heap tuples.  The value actually stored in pg_attribute (-1) indicates
	 * no cached value.  But when we copy these tuples into a tuple
	 * descriptor, we may then update attcacheoff in the copies. This speeds
	 * up the attribute walking process.
	 */
	int4		attcacheoff;
	/*
	 * atttypmod records type-specific data supplied at table creation time
	 * (for example, the max length of a varchar field).  It is passed to
	 * type-specific input and output functions as the third argument. The
	 * value will generally be -1 for types that do not need typmod.
	 */
	int4		atttypmod;
	/*
	 * attbyval is a copy of the typbyval field from pg_type for this
	 * attribute.  See atttypid comments above.
	 */
	bool		attbyval;
	/*----------
	 * attstorage tells for VARLENA attributes, what the heap access
	 * methods can do to it if a given tuple doesn't fit into a page.
	 * Possible values are
	 *		'p': Value must be stored plain always
	 *		'e': Value can be stored in "secondary" relation (if relation
	 *			 has one, see pg_class.reltoastrelid)
	 *		'm': Value can be stored compressed inline
	 *		'x': Value can be stored compressed inline or in "secondary"
	 * Note that 'm' fields can also be moved out to secondary storage,
	 * but only as a last resort ('e' and 'x' fields are moved first).
	 *----------
	 */
	char		attstorage;
	/*
	 * attalign is a copy of the typalign field from pg_type for this
	 * attribute.  See atttypid comments above.
	 */
	char		attalign;
	/* This flag represents the "NOT NULL" constraint */
	bool		attnotnull;
	/* Has DEFAULT value or not */
	bool		atthasdef;
	/* Is dropped (ie, logically invisible) or not */
	bool		attisdropped;
	/* Has a local definition (hence, do not drop when attinhcount is 0) */
	bool		attislocal;
	/* Number of times inherited from direct parent relation(s) */
	int4		attinhcount;

} FormData_pg_attribute;

履歴

コメント



トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS