GaussDB-DB_TAB_COLUMNS

49 阅读2分钟

GaussDB-DB_TAB_COLUMNS

DB_TAB_COLUMNS displays description information about columns of tables and views accessible to the current user. This view exists in the PG_CATALOG and SYS schemas. This view is accessible to all users and displays all information accessible to the current user.

NameTypeDescription
ownercharacter varying(64)Table owner.
table_namecharacter varying(64)Table name.
column_namecharacter varying(64)Column name.
data_typecharacter varying(128)Data type of a column.
data_type_modcharacter varying(3)Not supported. Its value is NULL.
data_type_ownercharacter varying(128)Owner of the data type of a column.
data_lengthintegerLength of a column, in bytes.
data_precisionintegerPrecision of the data type. It is valid for the numeric data type and NULL for other types.
data_scaleintegerNumber of decimal places. It is valid for the numeric data type and 0 for other data types.
nullablebpcharSpecifies whether the column can be null. The options are as follows:- y: yes.
  • n: no. For primary key constraints and non-null constraints, the value is n. | | column_id | integer | Sequence number of a column when the table is created. | | default_length | numeric | Length of the default value of a column, in bytes. | | data_default | text | Default value of a column. | | num_distinct | numeric | Number of different values in a column. | | low_value | raw | Minimum value in a column. | | high_value | raw | Maximum value in a column. | | density | numeric | Column density. | | num_nulls | numeric | Number of empty values in a column. | | num_buckets | numeric | Number of buckets in the histogram of a column. | | last_analyzed | date | Last analysis date. | | sample_size | numeric | Sample size used to analyze a column. | | character_set_name | character varying(44) | Not supported. Its value is NULL. | | char_col_decl_length | numeric | Declaration length of a column of the character type. | | global_stats | character varying(3) | Not supported. The value is NO. | | user_stats | character varying(3) | Not supported. The value is NO. | | avg_col_len | numeric | Average length of a column, in bytes. | | char_length | numeric | Column length (in the unit of bytes) which is valid only for varchar, nvarchar2, bpchar, and char types. | | char_used | character varying(1) | Not supported. Set it to B if the data type is varchar, nvarchar2, bpchar, or char, and to NULL for other data types. | | v80_fmt_image | character varying(3) | Not supported. Its value is NULL. | | data_upgraded | character varying(3) | Not supported. The value is YES. | | histogram | character varying(15) | Specifies whether the histogram exists and the type of the histogram.- NONE: no histogram.
  • FREQUENCY: frequency histogram.
  • EQUI_WIDTH: equal-width histogram. | | default_on_null | character varying(3) | Not supported. Its value is NULL. | | identity_column | character varying(3) | Not supported. Its value is NULL. | | evaluation_edition | character varying(128) | Not supported. Its value is NULL. | | unusable_before | character varying(128) | Not supported. Its value is NULL. | | unusable_beginning | character varying(128) | Not supported. Its value is NULL. | | collation | character varying(100) | Collation rule of a column. This column conflicts with reserved keywords. Therefore, add the view name when calling this column. | | comments | text | Comments. | | schema | character varying(64) | Name of the namespace to which the column belongs. |

更多详情请参考GaussDB 文档中心:doc.hcs.huawei.com/db/zh-cn/ga…