ctyunos操作系统部署 postgres报错,提示找不到 error:conflicting types for 'copy_file_range'
解决办法:
1、查找copy_fetch.c文件的位置
find / -name copy_fetch.c
发现copy_fetch.c文件在postgresql-10.1.tar.gz源码解压路径postgresql-10.1的子路径src/bin/pg_rewind/中。(/postgresql-10.1/src/bin/pg_rewind/)
2、进入postgresql-10.1.tar.gz源码解压路径postgresql-10.1,修改copy_fetch.c中所有函数名copy_file_range 为 copy_file_chunk
sed -i "s/copy_file_range/copy_file_chunk/g" /postgresql-10.1/src/bin/pg_rewind/copy_fetch.c
3、重新执行make && make install进行编译;
参考:https://support.huawei.com/enterprise/zh/knowledge/EKB1100061520