|
| 1 | +package io.tapdata.connector.postgres.error; |
| 2 | + |
| 3 | +import io.tapdata.exception.TapExClass; |
| 4 | +import io.tapdata.exception.TapExCode; |
| 5 | +import io.tapdata.exception.TapExLevel; |
| 6 | +import io.tapdata.exception.TapExType; |
| 7 | + |
| 8 | +@TapExClass( |
| 9 | + code = 41, |
| 10 | + module = "postgres-connector", |
| 11 | + describe = "Postgres Error Code", |
| 12 | + prefix = "PG") |
| 13 | +public interface PostgresErrorCode { |
| 14 | + @TapExCode( |
| 15 | + describe = "Failed to create publication, please analyze the specific error message. \n" + |
| 16 | + "Common errors and reasons: \n" + |
| 17 | + " ERROR: permission denied for database. \n" + |
| 18 | + "The current user does not have permission to create publications.", |
| 19 | + describeCN = "创建 publication 失败,需结合具体报错信息分析。\n" + |
| 20 | + "常见的报错及原因:\n" + |
| 21 | + "ERROR: permission denied for database. \n" + |
| 22 | + "当前用户没有创建 publication 的权限。", |
| 23 | + solution = "Solution (choose one): \n" + |
| 24 | + "1. Use a superuser connection (such as postgres). \n" + |
| 25 | + "2. Grant the current user the required permissions and execute: ALTER USER username REPLICATION;", |
| 26 | + solutionCN = "解决方案(任选其一):\n" + |
| 27 | + "1. 使用超级用户连接(例如 postgres)。\n" + |
| 28 | + "2. 赋予当前用户所需权限,执行:ALTER USER username REPLICATION;", |
| 29 | + dynamicDescription = "Execute sql failed: {}", |
| 30 | + dynamicDescriptionCN = "执行语句失败:{}", |
| 31 | + level = TapExLevel.CRITICAL, |
| 32 | + type = TapExType.RUNTIME |
| 33 | + ) |
| 34 | + String CREATE_PUBLICATION_FAILED = "410001"; |
| 35 | + |
| 36 | + @TapExCode( |
| 37 | + describe = "Failed to select publication, please analyze the specific error message. \n" + |
| 38 | + "Common errors and reasons: \n" + |
| 39 | + "ERROR: must be superuser or replication role to use replication slots. \n" + |
| 40 | + "The current user does not have permission to create publications.", |
| 41 | + describeCN = "查询 publication 失败,需结合具体报错信息分析。\n" + |
| 42 | + "常见的报错及原因:\n" + |
| 43 | + "ERROR: must be superuser or replication role to use replication slots \n" + |
| 44 | + "当前用户没有查询 publication 的权限。", |
| 45 | + solution = "Solution (choose one): \n" + |
| 46 | + "1. Use a superuser connection (such as postgres). \n" + |
| 47 | + "2. Grant the current user the required permissions and execute: ALTER USER username REPLICATION;", |
| 48 | + solutionCN = "解决方案(任选其一):\n" + |
| 49 | + "1. 使用超级用户连接(例如 postgres)。\n" + |
| 50 | + "2. 赋予当前用户所需权限,执行:ALTER USER username REPLICATION;", |
| 51 | + dynamicDescription = "Execute sql failed: {}", |
| 52 | + dynamicDescriptionCN = "执行语句失败:{}", |
| 53 | + level = TapExLevel.CRITICAL, |
| 54 | + type = TapExType.RUNTIME |
| 55 | + ) |
| 56 | + String SELECT_PUBLICATION_FAILED = "410002"; |
| 57 | +} |
0 commit comments