背景:
项目需要重新部署环境,利用navicat做数据迁移,功能入口如下图:
环境:
1、postgresql版本9.6;
2、部署系统ubuntu版本20;
3、navicat premium版本15;
问题1:ERROR: permission denied for relation hibernate_sequence
分析:数据库登录用户错误
解决:选择正确用户登录数据库,解决问题。
问题2:
[ERR] 31> CREATE OR REPLACE FUNCTION "public"."armor"(bytea)
RETURNS "pg_catalog"."text" AS '$libdir/pgcrypto', 'pg_armor'
LANGUAGE c IMMUTABLE STRICT
COST 1
[ERR] 31> ERROR: could not access file "$libdir/pgcrypto": No such file or directory
[DTF] 32> armor: Getting function structure
[DTF] Process terminated
分析:缺少postgresql-contrib-9.6插件
解决:
apt-get update
apt-get clean
sudo apt-get install -d postgresql-contrib-9.6
CREATE EXTENSION pgcrypto;
问题3:
[ERR] 31> DROP FUNCTION IF EXISTS "public"."armor"(bytea)
[ERR] 31> ERROR: cannot drop function armor(bytea) because extension pgcrypto requires it
HINT: You can drop extension pgcrypto instead.
[DTF] 32> armor: Getting function structure
[DTF] Process terminated
分析:系统插件函数无法被删除
解决:传输数据时候,不选择系统插件函数。
问题4:外部表的创建
分析:需要先创建外部表才能传输数据
解决:外部表创建见 https://blog.csdn.net/lp52054xgy/article/details/134859758
问题5:
[DTF] 9> sys_sessions: Drop table
[ERR] 9> SELECT * FROM "public"."sys_sessions"
[ERR] 9> ERROR: password is required
DETAIL: Non-superuser cannot connect if the server does not request a password.
HINT: Target server's authentication method must be changed.
[DTF] Process terminated
分析:外部表的用户映射password错误
解决:如下图甚至正确的密码。然后手动建立外部表,确认可以正常打开。传输数据时候排除掉外部表。