VastbaseG100

基于openGauss内核开发的企业级关系型数据库。

Menu

兼容虚拟列语法

vastbase=# CREATE TABLE gtest0 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (55) STORED);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "gtest0_pkey" for table "gtest0"
CREATE TABLE
vastbase=#  CREATE TABLE gtest1 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "gtest1_pkey" for table "gtest1"
CREATE TABLE
vastbase=#  insert into gtest0(a ) values (111);
INSERT 0 1
vastbase=# select * from gtest0;
  a  | b  
-----+----
 111 | 55
(1 row)

vastbase=#  insert into gtest1(a ) values (111);
INSERT 0 1
vastbase=#  select * from gtest1;
  a  |  b  
-----+-----
 111 | 222
(1 row)