!2399 针对default属性,补齐pg_get_tabledef()显示结果的漏洞
Merge pull request !2399 from 吕辉/pg_get_tabledef
This commit is contained in:
@ -1641,7 +1641,7 @@ static int get_table_attribute(
|
||||
find_nextval_seqoid_walker(adexpr, &tableinfo->autoinc_seqoid);
|
||||
tableinfo->autoinc_attnum = attrdef->adnum;
|
||||
appendStringInfo(buf, " %s", adsrc);
|
||||
} else {
|
||||
} else if (pg_strcasecmp(adsrc, "") != 0) {
|
||||
appendStringInfo(buf, " DEFAULT %s", adsrc);
|
||||
}
|
||||
if (isOnUpdate) {
|
||||
|
||||
@ -788,7 +788,7 @@ select * from pg_get_tabledef('test');
|
||||
CREATE TABLE test ( +
|
||||
a integer, +
|
||||
b timestamp without time zone DEFAULT now() ON UPDATE CURRENT_TIMESTAMP,+
|
||||
c timestamp with time zone DEFAULT ON UPDATE CURRENT_TIMESTAMP(5) +
|
||||
c timestamp with time zone ON UPDATE CURRENT_TIMESTAMP(5) +
|
||||
) +
|
||||
WITH (orientation=row, compression=no);
|
||||
(1 row)
|
||||
|
||||
Reference in New Issue
Block a user