In GaussDB(DWS), reserved keywords must be enclosed in double quotation marks when they are used as column names. The following reserved keywords are supported: desc, checksum, operator, and size.
Using the Name of a Hidden Column of a System Catalog As a Column Name¶
If the defined column name is the same as that of a hidden column in a GaussDB(DWS) system catalog ( including xc_node_id and tableoid, cmax, xmax, cmin, xmin, ctid, tid.), you need to rename the column. To rename the column, add _new at the end. For example, change xc_node_id to xc_node_id_new.
Input
DROP TABLE IF EXISTS `renameFieldName`;
CREATE TABLE IF NOT EXISTS `renameFieldName`(
xc_node_id int,
tableoid char(3),
cmax smallint,
xmax bigint auto_increment,
cmin varchar(10),
xmin int,
ctid int auto_increment,
tid int
);
DROP TABLE IF EXISTS `renameFieldName`;