当前位置:论坛首页 > Linux面板 > 求助

【已解答】SQL: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"

发表在 Linux面板2023-7-1 13:55 [复制链接] 7 3738

本帖最后由 堡塔运维小林 于 2023-7-1 21:21 编辑

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:
Linux正式版  8.0.0

系统版本:Linux正式版  8.0.0、PostgreSQL管理器 2.0、postgresql 14.2

问题描述:Postgresql的uuid-ossp扩展报错,删除重新安装也不行

相关截图(日志、错误):SQL: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"



微信图片_20230701135502.png
微信截图_20230701135518.png
使用道具 举报 只看该作者 回复
发表于 2023-7-1 21:21:30 | 显示全部楼层
您好,如果没有这个扩展文件,需要您去官网手动下载下来,再去执行创建扩展的命令,建议您到搜索引擎上面找一下相关的文档,如下面这个文档https://blog.51cto.com/u_15780455/6081498
使用道具 举报 回复 支持 反对
发表于 2023-7-1 22:30:11 | 显示全部楼层
堡塔运维小林 发表于 2023-7-1 21:21
您好,如果没有这个扩展文件,需要您去官网手动下载下来,再去执行创建扩展的命令,建议您到搜索引擎上面找 ...

这个试过了,也是不行,用的是宝塔PostgreSQL管理器 2.0
使用道具 举报 回复 支持 反对
发表于 2023-7-1 22:33:37 | 显示全部楼层
堡塔运维小林 发表于 2023-7-1 21:21
您好,如果没有这个扩展文件,需要您去官网手动下载下来,再去执行创建扩展的命令,建议您到搜索引擎上面找 ...

[root@VM-12-16-centos uuid-ossp]# make && make install
make -C ../../src/backend generated-headers
make[1]: Entering directory `/usr/local/pgsql/src/backend'
make -C catalog distprep generated-header-symlinks
make[2]: Entering directory `/usr/local/pgsql/src/backend/catalog'
make[2]: Nothing to be done for `distprep'.
make[2]: Nothing to be done for `generated-header-symlinks'.
make[2]: Leaving directory `/usr/local/pgsql/src/backend/catalog'
make -C utils distprep generated-header-symlinks
make[2]: Entering directory `/usr/local/pgsql/src/backend/utils'
make[2]: Nothing to be done for `distprep'.
make[2]: Nothing to be done for `generated-header-symlinks'.
make[2]: Leaving directory `/usr/local/pgsql/src/backend/utils'
make[1]: Leaving directory `/usr/local/pgsql/src/backend'
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../contrib/pgcrypto -I. -I. -I../../src/include  -D_GNU_SOURCE   -c -o uuid-ossp.o uuid-ossp.c
uuid-ossp.c:39:2: error: #error "please use configure's --with-uuid switch to select a UUID library"
#error "please use configure's --with-uuid switch to select a UUID library"
  ^
uuid-ossp.c: In function ‘uuid_generate_internal’:
uuid-ossp.c:274:5: error: unknown type name ‘uuid_t’
     uuid_t  uu;
     ^
uuid-ossp.c:275:23: error: ‘uuid_s_ok’ undeclared (first use in this function)
     uint32_t status = uuid_s_ok;
                       ^
uuid-ossp.c:275:23: note: each undeclared identifier is reported only once for each function it appears in
uuid-ossp.c:278:5: warning: implicit declaration of function ‘uuid_create’ [-Wimplicit-function-declaration]
     uuid_create(&uu, &status);
     ^
uuid-ossp.c:282:6: warning: implicit declaration of function ‘uuid_to_string’ [-Wimplicit-function-declaration]
      uuid_to_string(&uu, &str, &status);
      ^
uuid-ossp.c:74:20: error: unknown type name ‘uuid_t’
#define dce_uuid_t uuid_t
                    ^
uuid-ossp.c:311:5: note: in expansion of macro ‘dce_uuid_t’
     dce_uuid_t uu;
     ^
uuid-ossp.c:82:4: error: request for member ‘time_low’ in something not a structure or union
  uu.time_low = pg_hton32(uu.time_low); \
    ^
uuid-ossp.c:350:5: note: in expansion of macro ‘UUID_TO_NETWORK’
     UUID_TO_NETWORK(uu);
     ^
In file included from uuid-ossp.c:19:0:
uuid-ossp.c:82:28: error: request for member ‘time_low’ in something not a structure or union
  uu.time_low = pg_hton32(uu.time_low); \
                            ^
../../src/include/port/pg_bswap.h:55:41: note: in definition of macro ‘pg_bswap32’
#define pg_bswap32(x) __builtin_bswap32(x)
                                         ^
uuid-ossp.c:82:16: note: in expansion of macro ‘pg_hton32’
  uu.time_low = pg_hton32(uu.time_low); \
                ^
uuid-ossp.c:350:5: note: in expansion of macro ‘UUID_TO_NETWORK’
     UUID_TO_NETWORK(uu);
     ^
uuid-ossp.c:83:4: error: request for member ‘time_mid’ in something not a structure or union
  uu.time_mid = pg_hton16(uu.time_mid); \
    ^
uuid-ossp.c:350:5: note: in expansion of macro ‘UUID_TO_NETWORK’
     UUID_TO_NETWORK(uu);
     ^
In file included from uuid-ossp.c:19:0:
uuid-ossp.c:83:28: error: request for member ‘time_mid’ in something not a structure or union
  uu.time_mid = pg_hton16(uu.time_mid); \
                            ^
../../src/include/port/pg_bswap.h:33:41: note: in definition of macro ‘pg_bswap16’
#define pg_bswap16(x) __builtin_bswap16(x)
                                         ^
uuid-ossp.c:83:16: note: in expansion of macro ‘pg_hton16’
  uu.time_mid = pg_hton16(uu.time_mid); \
                ^
uuid-ossp.c:350:5: note: in expansion of macro ‘UUID_TO_NETWORK’
     UUID_TO_NETWORK(uu);
     ^
uuid-ossp.c:84:4: error: request for member ‘time_hi_and_version’ in something not a structure or union
  uu.time_hi_and_version = pg_hton16(uu.time_hi_and_version); \
    ^
uuid-ossp.c:350:5: note: in expansion of macro ‘UUID_TO_NETWORK’
     UUID_TO_NETWORK(uu);
     ^
In file included from uuid-ossp.c:19:0:
uuid-ossp.c:84:39: error: request for member ‘time_hi_and_version’ in something not a structure or union
  uu.time_hi_and_version = pg_hton16(uu.time_hi_and_version); \
                                       ^
../../src/include/port/pg_bswap.h:33:41: note: in definition of macro ‘pg_bswap16’
#define pg_bswap16(x) __builtin_bswap16(x)
                                         ^
uuid-ossp.c:84:27: note: in expansion of macro ‘pg_hton16’
  uu.time_hi_and_version = pg_hton16(uu.time_hi_and_version); \
                           ^
uuid-ossp.c:350:5: note: in expansion of macro ‘UUID_TO_NETWORK’
     UUID_TO_NETWORK(uu);
     ^
uuid-ossp.c:96:4: error: request for member ‘time_hi_and_version’ in something not a structure or union
  uu.time_hi_and_version &= 0x0FFF; \
    ^
uuid-ossp.c:351:5: note: in expansion of macro ‘UUID_V3_OR_V5’
     UUID_V3_OR_V5(uu, v);
     ^
uuid-ossp.c:97:4: error: request for member ‘time_hi_and_version’ in something not a structure or union
  uu.time_hi_and_version |= (v << 12); \
    ^
uuid-ossp.c:351:5: note: in expansion of macro ‘UUID_V3_OR_V5’
     UUID_V3_OR_V5(uu, v);
     ^
uuid-ossp.c:98:4: error: request for member ‘clock_seq_hi_and_reserved’ in something not a structure or union
  uu.clock_seq_hi_and_reserved &= 0x3F; \
    ^
uuid-ossp.c:351:5: note: in expansion of macro ‘UUID_V3_OR_V5’
     UUID_V3_OR_V5(uu, v);
     ^
uuid-ossp.c:99:4: error: request for member ‘clock_seq_hi_and_reserved’ in something not a structure or union
  uu.clock_seq_hi_and_reserved |= 0x80; \
    ^
uuid-ossp.c:351:5: note: in expansion of macro ‘UUID_V3_OR_V5’
     UUID_V3_OR_V5(uu, v);
     ^
uuid-ossp.c:358:26: error: ‘str’ undeclared (first use in this function)
     uuid_to_string(&uu, &str, &status);
                          ^
uuid-ossp.c:358:32: error: ‘status’ undeclared (first use in this function)
     uuid_to_string(&uu, &str, &status);
                                ^
In file included from ../../src/include/postgres.h:47:0,
                 from uuid-ossp.c:14:
../../src/include/utils/elog.h:141:15: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    __VA_ARGS__, errfinish(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
               ^
../../src/include/utils/elog.h:158:2: note: in expansion of macro ‘ereport_domain’
  ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
  ^
uuid-ossp.c:367:6: note: in expansion of macro ‘ereport’
      ereport(ERROR,
      ^
uuid-ossp.c:386:8: warning: implicit declaration of function ‘arc4random’ [-Wimplicit-function-declaration]
        (unsigned long) arc4random(),
        ^
make: *** [uuid-ossp.o] Error 1
使用道具 举报 回复 支持 反对
发表于 2023-7-1 22:51:13 | 显示全部楼层
564880 发表于 2023-7-1 22:30
这个试过了,也是不行,用的是宝塔PostgreSQL管理器 2.0

您好,复制下面的命令去执行,执行成功后再去make试试
sudo yum install libuuid-devel
使用道具 举报 回复 支持 反对
发表于 2023-12-19 18:00:44 | 显示全部楼层
本帖最后由 bbhkxd 于 2023-12-19 18:12 编辑

解决了。进入 /usr/local/pgsql 重新编译pgsql     指定uuid插件

./configure --prefix=/www/server/pgsql --without-readline --with-uuid=e2fs


然后进入

/usr/local/pgsql/contrib/uuid-ossp

执行mak &&e  make install
希望官方把这个 --with-uuid=e2fs给加上,免得出现各种操蛋问题,耽误我半天时间
使用道具 举报 回复 支持 反对
发表于 2023-12-19 18:13:14 | 显示全部楼层
堡塔运维小林 发表于 2023-7-1 22:51
您好,复制下面的命令去执行,执行成功后再去make试试
sudo yum install libuuid-devel ...

希望安装pgsql的命令中把这个 --with-uuid=e2fs给加上,  看下我下面的回复
使用道具 举报 回复 支持 反对
发表于 2024-9-28 13:23:55 | 显示全部楼层
为啥我按照上面的操作还是无法创建
CREATE EXTENSION IF NOT EXISTS uuid-ossp;
宝塔pgsql管理器2.6安装的pgsql16.1版本
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表