antdb=# create table t_parent (id int primary key,name varchar(30)); create table t_child (id int,name varchar(30)) distribute by hash(name);
CREATE TABLE antdb=# create table t_child (id int,name varchar(30)) distribute by hash(name); CREATE TABLE antdb=# antdb=# alter table t_child postgres-# add constraint fkey_t_child postgres-# foreign key (id) postgres-# references t_parent (id); ERROR: Cannot create foreign key whose evaluation cannot be enforced to remote nodes antdb=# antdb=# alter table t_child distribute by hash (id); ALTER TABLE antdb=# alter table t_child
add constraint fkey_t_child foreign key (id) references t_parent (id); ALTER TABLE
antdb=# drop table t_child; DROP TABLE antdb=# create table t_child (id int,name varchar(30)) distribute by hash(name); CREATE TABLE antdb=# alter table t_parent distribute by replication; ALTER TABLE antdb=# alter table t_child
postgres-# add constraint fkey_t_child postgres-# foreign key (id) postgres-# references t_parent (id); ALTER TABLE antdb=#
fe_sendauth: no password supplied
可能的报错信息:
WARNING: on coordinator execute "set FORCE_PARALLEL_MODE = off; SELECT adb_PAUSE_CLUSTER();" fail ERROR: error message from poolmgr:reconnect three thimes , fe_sendauth: no password supplied
处理方式: 检查下集群中coord的hba信息,是否存在:对于集群内部主机IP有md5的认证方式。
在adbmgr中执行 :show hba nodename 来查看节点的hba信息。 FATAL: invalid value for parameter “TimeZone”: “Asia/Shanghai”
可能的报错信息:
FATAL: invalid value for parameter "TimeZone": "Asia/Shanghai" FATAL: invalid value for parameter "TimeZone": "asia/shanghai" FATAL: invalid value for parameter "TimeZone": "utc"
解决方式
目前不允许在非分片键上创建外键,处理方式:
复现SQL:
antdb=# create table t_parent (id int primary key,name varchar(30));
create table t_child (id int,name varchar(30)) distribute by hash(name);
CREATE TABLE
antdb=# create table t_child (id int,name varchar(30)) distribute by hash(name);
CREATE TABLE
antdb=#
antdb=# alter table t_child
postgres-# add constraint fkey_t_child
postgres-# foreign key (id)
postgres-# references t_parent (id);
ERROR: Cannot create foreign key whose evaluation cannot be enforced to remote nodes
antdb=#
antdb=# alter table t_child distribute by hash (id);
ALTER TABLE
antdb=# alter table t_child
add constraint fkey_t_child
foreign key (id)
references t_parent (id);
ALTER TABLE
antdb=# drop table t_child;
DROP TABLE
antdb=# create table t_child (id int,name varchar(30)) distribute by hash(name);
CREATE TABLE
antdb=# alter table t_parent distribute by replication;
ALTER TABLE
antdb=# alter table t_child
postgres-# add constraint fkey_t_child
postgres-# foreign key (id)
postgres-# references t_parent (id);
ALTER TABLE
antdb=#
fe_sendauth: no password supplied
可能的报错信息:
WARNING: on coordinator execute "set FORCE_PARALLEL_MODE = off; SELECT adb_PAUSE_CLUSTER();" fail ERROR: error message from poolmgr:reconnect three thimes , fe_sendauth: no password supplied
处理方式:
检查下集群中coord的hba信息,是否存在:对于集群内部主机IP有md5的认证方式。
在adbmgr中执行 :show hba nodename 来查看节点的hba信息。
FATAL: invalid value for parameter “TimeZone”: “Asia/Shanghai”
可能的报错信息:
FATAL: invalid value for parameter "TimeZone": "Asia/Shanghai"
FATAL: invalid value for parameter "TimeZone": "asia/shanghai"
FATAL: invalid value for parameter "TimeZone": "utc"
处理方式:
数据库内支持的时区,使用下列sql查询,注意时区名的大小写。
select * from adb_catalog.adb_timezone_names;
若JDBC中没有配置该参数,则按步骤2的说明检查。
ll $ADBHOME/share/postgresql/timezone
total 232
drwxr-xr-x 2 antdb antdb 4096 Apr 16 15:59 Africa
drwxr-xr-x 6 antdb antdb 4096 Apr 16 15:59 America
drwxr-xr-x 2 antdb antdb 4096 Apr 16 15:59 Antarctica
drwxr-xr-x 2 antdb antdb 25 Apr 16 15:59 Arctic
drwxr-xr-x 2 antdb antdb 4096 Apr 16 15:59 Asia
......
drwxr-xr-x 2 antdb antdb 4096 Apr 16 15:59 US
-rwxr-xr-x 1 antdb antdb 114 Apr 16 15:48 UTC
-rwxr-xr-x 1 antdb antdb 1905 Apr 16 15:48 WET
-rwxr-xr-x 1 antdb antdb 1535 Apr 16 15:48 W-SU
-rwxr-xr-x 1 antdb antdb 114 Apr 16 15:48 Zulu