{"Entry":{"collection":"catalog","key":"pg_attribute","name":"pg_attribute","aliases":[],"metadata":{"changed_in":["8.0","8.4","9.0","9.1","9.2","10","11","12","14","16","17","18"],"changes":[{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"7.4","listing":[],"order":false,"removed":["attisset"],"status":"changed","to":"8.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row.","name":"attcacheoff","to":"Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row"},{"from":"This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value.","name":"atthasdef","to":"This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value"},{"from":"The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed.","name":"attinhcount","to":"The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed"},{"from":"This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL.","name":"attisdropped","to":"This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL"},{"from":"This column is defined locally in the relation. Note that a column may be locally defined and inherited simultaneously.","name":"attislocal","to":"This column is defined locally in the relation. Note that a column may be locally defined and inherited simultaneously"},{"from":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means \"it's an array\".)","name":"attndims","to":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means \"it's an array\")"},{"from":"This represents a not-null constraint. It is possible to change this column to enable or disable the constraint.","name":"attnotnull","to":"This represents a not-null constraint. It is possible to change this column to enable or disable the constraint"},{"from":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid, have (arbitrary) negative numbers.","name":"attnum","to":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid, have (arbitrary) negative numbers"},{"from":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of \"most common values\" to collect, and the target number of histogram bins to create.","name":"attstattarget","to":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of \"most common values\" to collect, and the target number of histogram bins to create"},{"from":"Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy.","name":"attstorage","to":"Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy"},{"from":"atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod.","name":"atttypmod","to":"atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod"}],"from":"8.1","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row","name":"attcacheoff","to":"Always -1 in storage, but when loaded into a row descriptor in memory this might be updated to cache the offset of the attribute within the row"},{"from":"This column is defined locally in the relation. Note that a column may be locally defined and inherited simultaneously","name":"attislocal","to":"This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously"}],"from":"8.2","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.3","types":[],"unlisted":[]},{"added":["attacl"],"attributes":[],"description_changed":false,"descriptions":[],"from":"8.3","listing":[],"order":false,"removed":[],"status":"changed","to":"8.4","types":[],"unlisted":[]},{"added":["attoptions"],"attributes":[],"description_changed":false,"descriptions":[{"from":"This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value","name":"atthasdef","to":"This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value."},{"from":"The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed","name":"attinhcount","to":"The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed."},{"from":"This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL","name":"attisdropped","to":"This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL."},{"from":"This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously","name":"attislocal","to":"This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously."},{"from":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means \"it's an array\")","name":"attndims","to":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means \"it's an array\".)"},{"from":"This represents a not-null constraint. It is possible to change this column to enable or disable the constraint","name":"attnotnull","to":"This represents a not-null constraint. It is possible to change this column to enable or disable the constraint."},{"from":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid, have (arbitrary) negative numbers","name":"attnum","to":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid, have (arbitrary) negative numbers."},{"from":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of \"most common values\" to collect, and the target number of histogram bins to create","name":"attstattarget","to":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of \"most common values\" to collect, and the target number of histogram bins to create."},{"from":"Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy","name":"attstorage","to":"Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy."},{"from":"atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod","name":"atttypmod","to":"atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod."}],"from":"8.4","listing":[],"order":false,"removed":[],"status":"changed","to":"9.0","types":[],"unlisted":[]},{"added":["attcollation"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.0","listing":[],"order":false,"removed":[],"status":"changed","to":"9.1","types":[],"unlisted":[]},{"added":["attfdwoptions"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.1","listing":[],"order":false,"removed":[],"status":"changed","to":"9.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"This represents a not-null constraint. It is possible to change this column to enable or disable the constraint.","name":"attnotnull","to":"This represents a not-null constraint."}],"from":"9.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.5","types":[],"unlisted":[]},{"added":["attidentity"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Attribute-level foreign data wrapper options, as \"keyword=value\" strings","name":"attfdwoptions","to":"Attribute-level foreign data wrapper options, as “keyword=value” strings"},{"from":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means \"it's an array\".)","name":"attndims","to":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means “it's an array”.)"},{"from":"Attribute-level options, as \"keyword=value\" strings","name":"attoptions","to":"Attribute-level options, as “keyword=value” strings"},{"from":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of \"most common values\" to collect, and the target number of histogram bins to create.","name":"attstattarget","to":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of “most common values” to collect, and the target number of histogram bins to create."}],"from":"9.6","listing":[],"order":false,"removed":[],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":["atthasmissing","attmissingval"],"attributes":[],"description_changed":false,"descriptions":[],"from":"10","listing":[],"order":false,"removed":[],"status":"changed","to":"11","types":[],"unlisted":[]},{"added":["attgenerated"],"attributes":[],"description_changed":false,"descriptions":[{"from":"This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value.","name":"atthasdef","to":"This column has a default expression or generation expression, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the expression. (Check attgenerated to determine whether this is a default or a generation expression.)"},{"from":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid, have (arbitrary) negative numbers.","name":"attnum","to":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as ctid, have (arbitrary) negative numbers."}],"from":"11","listing":[],"order":false,"removed":[],"status":"changed","to":"12","types":[],"unlisted":[]},{"added":["attcompression"],"attributes":[],"description_changed":false,"descriptions":[{"from":"The defined collation of the column, or zero if the column is not of a collatable data type.","name":"attcollation","to":"The defined collation of the column, or zero if the column is not of a collatable data type"},{"from":"The data type of this column","name":"atttypid","to":"The data type of this column (zero for a dropped column)"}],"from":"13","listing":[],"order":true,"removed":[],"status":"changed","to":"14","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"15","listing":[],"order":true,"removed":[],"status":"changed","to":"16","types":[{"from":"int4","name":"attinhcount","to":"int2"},{"from":"int4","name":"attndims","to":"int2"},{"from":"int4","name":"attstattarget","to":"int2"}],"unlisted":[]},{"added":[],"attributes":[{"attribute":"not_null","from":true,"name":"attstattarget","to":false}],"description_changed":false,"descriptions":[{"from":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of “most common values” to collect, and the target number of histogram bins to create.","name":"attstattarget","to":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A null value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of “most common values” to collect, and the target number of histogram bins to create."}],"from":"16","listing":[],"order":true,"removed":[],"status":"changed","to":"17","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"If a zero byte (''), then not a generated column. Otherwise, s = stored. (Other values might be added in the future.)","name":"attgenerated","to":"If a zero byte (''), then not a generated column. Otherwise, s = stored, v = virtual. A stored generated column is physically stored like a normal column. A virtual generated column is physically stored as a null value, with the actual value being computed at run time."},{"from":"This represents a not-null constraint.","name":"attnotnull","to":"This column has a (possibly invalid) not-null constraint."}],"from":"17","listing":[],"order":false,"removed":["attcacheoff"],"status":"changed","to":"18","types":[],"unlisted":[]}],"column_count":25,"content_hash":"19c9d21625a21be0665a7b51e3c852062a51d92487a7d47d4c529cd3086924cb","first_version":"7.4","imported_at":"2026-09-30T00:40:55.338998+08:00","kind":"catalog","last_version":"20","name":"pg_attribute","position":6,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:c9787bd15fe88cbb9f99098096e731d4d8c609ca66feaeccbbc5bad688b0f57b","summary":"The catalog pg_attribute stores information about table columns.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_attribute","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_attribute","SourceRevision":"english-manuals:c9787bd15fe88cbb9f99098096e731d4d8c609ca66feaeccbbc5bad688b0f57b","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"The table this column belongs to","description_zh":"","documented":true,"documented_name":"attrelid","hidden":false,"name":"attrelid","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":2,"description":"The column name","description_zh":"","documented":true,"documented_name":"attname","hidden":false,"name":"attname","not_null":true,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":3,"description":"The data type of this column (zero for a dropped column)","description_zh":"","documented":true,"documented_name":"atttypid","hidden":false,"name":"atttypid","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"A copy of pg_type.typlen of this column's type","description_zh":"","documented":true,"documented_name":"attlen","hidden":false,"name":"attlen","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":5,"description":"The number of the column. Ordinary columns are numbered from 1 up. System columns, such as ctid, have (arbitrary) negative numbers.","description_zh":"","documented":true,"documented_name":"attnum","hidden":false,"name":"attnum","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":6,"description":"atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod.","description_zh":"","documented":true,"documented_name":"atttypmod","hidden":false,"name":"atttypmod","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":7,"description":"Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means “it's an array”.)","description_zh":"","documented":true,"documented_name":"attndims","hidden":false,"name":"attndims","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":8,"description":"A copy of pg_type.typbyval of this column's type","description_zh":"","documented":true,"documented_name":"attbyval","hidden":false,"name":"attbyval","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":9,"description":"A copy of pg_type.typalign of this column's type","description_zh":"","documented":true,"documented_name":"attalign","hidden":false,"name":"attalign","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":10,"description":"Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy.","description_zh":"","documented":true,"documented_name":"attstorage","hidden":false,"name":"attstorage","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":11,"description":"The current compression method of the column. Typically this is '\\0' to specify use of the current default setting (see default_toast_compression). Otherwise, 'p' selects pglz compression, while 'l' selects LZ4 compression. However, this field is ignored whenever attstorage does not allow compression.","description_zh":"","documented":true,"documented_name":"attcompression","hidden":false,"name":"attcompression","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":12,"description":"This column has a (possibly invalid) not-null constraint.","description_zh":"","documented":true,"documented_name":"attnotnull","hidden":false,"name":"attnotnull","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":13,"description":"This column has a default expression or generation expression, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the expression. (Check attgenerated to determine whether this is a default or a generation expression.)","description_zh":"","documented":true,"documented_name":"atthasdef","hidden":false,"name":"atthasdef","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":14,"description":"This column has a value which is used where the column is entirely missing from the row, as happens when a column is added with a non-volatile DEFAULT value after the row is created. The actual value used is stored in the attmissingval column.","description_zh":"","documented":true,"documented_name":"atthasmissing","hidden":false,"name":"atthasmissing","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":15,"description":"If a zero byte (''), then not an identity column. Otherwise, a = generated always, d = generated by default.","description_zh":"","documented":true,"documented_name":"attidentity","hidden":false,"name":"attidentity","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":16,"description":"If a zero byte (''), then not a generated column. Otherwise, s = stored, v = virtual. A stored generated column is physically stored like a normal column. A virtual generated column is physically stored as a null value, with the actual value being computed at run time.","description_zh":"","documented":true,"documented_name":"attgenerated","hidden":false,"name":"attgenerated","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":17,"description":"This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL.","description_zh":"","documented":true,"documented_name":"attisdropped","hidden":false,"name":"attisdropped","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":18,"description":"This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously.","description_zh":"","documented":true,"documented_name":"attislocal","hidden":false,"name":"attislocal","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":19,"description":"The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed.","description_zh":"","documented":true,"documented_name":"attinhcount","hidden":false,"name":"attinhcount","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":20,"description":"The defined collation of the column, or zero if the column is not of a collatable data type","description_zh":"","documented":true,"documented_name":"attcollation","hidden":false,"name":"attcollation","not_null":true,"references":"pg_collation.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":21,"description":"attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A null value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of “most common values” to collect, and the target number of histogram bins to create.","description_zh":"","documented":true,"documented_name":"attstattarget","hidden":false,"name":"attstattarget","not_null":false,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":1,"attnum":22,"description":"Column-level access privileges, if any have been granted specifically on this column","description_zh":"","documented":true,"documented_name":"attacl","hidden":false,"name":"attacl","not_null":false,"references":"","type":"aclitem[]","type_modifier":-1,"type_oid":1034},{"array_dimensions":1,"attnum":23,"description":"Attribute-level options, as “keyword=value” strings","description_zh":"","documented":true,"documented_name":"attoptions","hidden":false,"name":"attoptions","not_null":false,"references":"","type":"text[]","type_modifier":-1,"type_oid":1009},{"array_dimensions":1,"attnum":24,"description":"Attribute-level foreign data wrapper options, as “keyword=value” strings","description_zh":"","documented":true,"documented_name":"attfdwoptions","hidden":false,"name":"attfdwoptions","not_null":false,"references":"","type":"text[]","type_modifier":-1,"type_oid":1009},{"array_dimensions":0,"attnum":25,"description":"This column has a one element array containing the value used when the column is entirely missing from the row, as happens when the column is added with a non-volatile DEFAULT value after the row is created. The value is only used when atthasmissing is true. If there is no value the column is null.","description_zh":"","documented":true,"documented_name":"attmissingval","hidden":false,"name":"attmissingval","not_null":false,"references":"","type":"anyarray","type_modifier":-1,"type_oid":2277}],"description":"The catalog pg_attribute stores information about table columns. There will be exactly one pg_attribute row for every column in every table in the database. (There will also be attribute entries for indexes, and indeed all objects that have pg_class entries.)\n\nThe term attribute is equivalent to column and is used for historical reasons.","description_zh":"","doc":{"anchor":"id-1.10.4.9.5","file":"catalog-pg-attribute.html","lang":"en","sha256":"693893443e0034a071589d625af2eef3fc602857343f5604c9b81a04b49e95a6","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["attrelid","attname","atttypid","attlen","attnum","atttypmod","attndims","attbyval","attalign","attstorage","attcompression","attnotnull","atthasdef","atthasmissing","attidentity","attgenerated","attisdropped","attislocal","attinhcount","attcollation","attstattarget","attacl","attoptions","attfdwoptions","attmissingval"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.9.5","file":"catalog-pg-attribute.html","lang":"en","sha256":"693893443e0034a071589d625af2eef3fc602857343f5604c9b81a04b49e95a6","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["attrelid","attname","atttypid","attlen","attnum","atttypmod","attndims","attbyval","attalign","attstorage","attcompression","attnotnull","atthasdef","atthasmissing","attidentity","attgenerated","attisdropped","attislocal","attinhcount","attcollation","attstattarget","attacl","attoptions","attfdwoptions","attmissingval"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_attribute","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_attribute","Summary":"目录pg_attribute存储关于表列的信息。数据库中每个表的每一列，在pg_attribute中都恰好有一行。（其中也包括索引的属性项，实际上，凡是在pg_class中有项的对象，都有对应的属性项。）\n\n术语属性等同于列，这里使用它只是出于历史原因。","BodyHTML":"\u003cp\u003e目录pg_attribute存储关于表列的信息。数据库中每个表的每一列，在pg_attribute中都恰好有一行。（其中也包括索引的属性项，实际上，凡是在pg_class中有项的对象，都有对应的属性项。）\n\n术语属性等同于列，这里使用它只是出于历史原因。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"5b75251e55627e038412e2221fab6af7a7265281023e9ce9a254f4d90b94e84a","Payload":{"columns":[{"description_zh":"此列所属的表","name":"attrelid","type":"oid","zh_from":"doc"},{"description_zh":"列名称","name":"attname","type":"name","zh_from":"doc"},{"description_zh":"此列的数据类型（删除的列为零）","name":"atttypid","type":"oid","zh_from":"doc"},{"description_zh":"该列数据类型的pg_type.typlen副本","name":"attlen","type":"smallint","zh_from":"doc"},{"description_zh":"列的编号。一般列从1开始向上编号。系统列，如ctid，则拥有（任意）负值编号。","name":"attnum","type":"smallint","zh_from":"doc"},{"description_zh":"atttypmod记录了在表创建时提供的类型相关数据（例如一个varchar列的最大长度）。它会被传递给类型相关的输入函数和长度强制转换函数。对于那些不需要atttypmod的类型，这个值通常为 -1。","name":"atttypmod","type":"integer","zh_from":"doc"},{"description_zh":"如果该列是数组类型，则为维数；否则为 0。（目前并不会强制检查数组维数，因此任何非零值实际上都只意味着“这是一个数组”。）","name":"attndims","type":"smallint","zh_from":"doc"},{"description_zh":"该列类型的pg_type.typbyval的一个拷贝","name":"attbyval","type":"boolean","zh_from":"doc"},{"description_zh":"该列类型的 pg_type.typalign 的一个拷贝","name":"attalign","type":"\"char\"","zh_from":"doc"},{"description_zh":"通常是该列类型的pg_type.typstorage的一个拷贝。对于可TOAST的数据类型，这可以在列创建后被修改以控制存储策略。","name":"attstorage","type":"\"char\"","zh_from":"doc"},{"description_zh":"该列当前的压缩方法。通常为'\\0'，表示使用当前默认设置（见default_toast_compression）。否则，'p' 选择 pglz 压缩，而'l' 选择 LZ4 压缩。但是，当attstorage不允许压缩时，该字段会被忽略。","name":"attcompression","type":"\"char\"","zh_from":"doc"},{"description_zh":"此列具有一个非空约束（可能尚未验证）","name":"attnotnull","type":"boolean","zh_from":"doc"},{"description_zh":"该列有一个默认表达式或生成表达式，在此情况下在pg_attrdef目录中会有一个对应项来真正定义该表达式。（检查attgenerated以确定是默认还是生成表达式。）","name":"atthasdef","type":"boolean","zh_from":"doc"},{"description_zh":"此列有一个值，供该列在数据行中完全缺失时使用；在数据行创建之后添加带有非易失性 DEFAULT 值的列时，就会出现这种情况。实际使用的值存储在 attmissingval 列中。","name":"atthasmissing","type":"boolean","zh_from":"doc"},{"description_zh":"如果是一个零字节（''），则不是一个标识列。否则，a = 总是生成，d = 默认生成。","name":"attidentity","type":"\"char\"","zh_from":"doc"},{"description_zh":"如果是零字节（''），则不是生成列。否则，s = 存储式（stored），v = 虚拟（virtual）。存储式生成列会像普通列一样实际存储；虚拟生成列则在物理上存储为空值，实际值在运行时计算。","name":"attgenerated","type":"\"char\"","zh_from":"doc"},{"description_zh":"该列被删除且不再有效。一个删除的列仍然物理存在于表中，但是会被解析器忽略并因此无法通过SQL访问。","name":"attisdropped","type":"boolean","zh_from":"doc"},{"description_zh":"该列是由关系本地定义的。注意一个列可以同时是本地定义和继承的。","name":"attislocal","type":"boolean","zh_from":"doc"},{"description_zh":"该列直接祖先的数量。祖先数量非零的列不能被删除，也不能被重命名。","name":"attinhcount","type":"smallint","zh_from":"doc"},{"description_zh":"该列定义的排序规则；如果该列的数据类型不支持排序规则，则为零。","name":"attcollation","type":"oid","zh_from":"doc"},{"description_zh":"attstattarget 控制 ANALYZE 为该列收集统计信息时的细节级别。零值表示不应收集统计信息。空值表示使用系统默认统计目标。正值的确切含义依赖于数据类型。对于标量数据类型，attstattarget 既是要收集的“高频值”目标个数，也是要创建的直方图桶目标个数。","name":"attstattarget","type":"smallint","zh_from":"doc"},{"description_zh":"列级访问权限，如果此列上已有特别授予的权限","name":"attacl","type":"aclitem[]","zh_from":"doc"},{"description_zh":"属性级选项，以“keyword=value”形式的字符串","name":"attoptions","type":"text[]","zh_from":"doc"},{"description_zh":"属性级的外部数据包装器选项，以“keyword=value”形式的字符串","name":"attfdwoptions","type":"text[]","zh_from":"doc"},{"description_zh":"此列包含一个单元素数组，其中的值供该列在数据行中完全缺失时使用；在数据行创建之后添加带有非易失性 DEFAULT 值的列时，就会出现这种情况。只有 atthasmissing 为真时才使用此值。如果没有这样的值，则此列为 NULL。","name":"attmissingval","type":"anyarray","zh_from":"doc"}],"description_zh":"目录pg_attribute存储关于表列的信息。数据库中每个表的每一列，在pg_attribute中都恰好有一行。（其中也包括索引的属性项，实际上，凡是在pg_class中有项的对象，都有对应的属性项。）\n\n术语属性等同于列，这里使用它只是出于历史原因。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
