0

当我尝试运行 pgbench 时,在初始化阶段遇到了“尚不支持此 ALTER TABLE 命令”的错误。请参阅下面的详细信息:

$ pgbench -i -U postgres -d postgres -p 5433 -h 127.0.0.1  
NOTICE:  table "pgbench_branches" does not exist, skipping  
WARNING:  Storage parameter fillfactor is unsupported, ignoring  
NOTICE:  table "pgbench_tellers" does not exist, skipping  
WARNING:  Storage parameter fillfactor is unsupported, ignoring  
NOTICE:  table "pgbench_accounts" does not exist, skipping  
WARNING:  Storage parameter fillfactor is unsupported, ignoring  
NOTICE:  table "pgbench_history" does not exist, skipping  
creating tables...  
10000 tuples done.  
20000 tuples done.  
30000 tuples done.  
40000 tuples done.  
50000 tuples done.  
60000 tuples done.  
70000 tuples done.  
80000 tuples done.  
90000 tuples done.  
100000 tuples done.  
**set primary key...  
ERROR:  This ALTER TABLE command is not yet supported**.  
4

1 回答 1

2

In YugaByte DB, currently, the PRIMARY KEY clause has to be specified as part of the CREATE TABLE statement, and cannot be added after the fact via an ALTER TABLE command.

We have made a recent change to the "pgbench" utility (that's bundled as part of the YugaByte DB distribution) to specify the PRIMARY KEY as part of the CREATE TABLE statement itself.

The relevant issue is: https://github.com/YugaByte/yugabyte-db/issues/1774 The relevant commit: https://github.com/YugaByte/yugabyte-db/commit/35b79bc35eede9907d917d72e516350a4f6bd281

于 2019-08-20T18:54:54.627 回答