【已解答】SQL: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
本帖最后由 堡塔运维小林 于 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"
您好,如果没有这个扩展文件,需要您去官网手动下载下来,再去执行创建扩展的命令,建议您到搜索引擎上面找一下相关的文档,如下面这个文档https://blog.51cto.com/u_15780455/6081498 堡塔运维小林 发表于 2023-7-1 21:21
您好,如果没有这个扩展文件,需要您去官网手动下载下来,再去执行创建扩展的命令,建议您到搜索引擎上面找 ...
这个试过了,也是不行,用的是宝塔PostgreSQL管理器 2.0 堡塔运维小林 发表于 2023-7-1 21:21
您好,如果没有这个扩展文件,需要您去官网手动下载下来,再去执行创建扩展的命令,建议您到搜索引擎上面找 ...
# make && make install
make -C ../../src/backend generated-headers
make: Entering directory `/usr/local/pgsql/src/backend'
make -C catalog distprep generated-header-symlinks
make: Entering directory `/usr/local/pgsql/src/backend/catalog'
make: Nothing to be done for `distprep'.
make: Nothing to be done for `generated-header-symlinks'.
make: Leaving directory `/usr/local/pgsql/src/backend/catalog'
make -C utils distprep generated-header-symlinks
make: Entering directory `/usr/local/pgsql/src/backend/utils'
make: Nothing to be done for `distprep'.
make: Nothing to be done for `generated-header-symlinks'.
make: Leaving directory `/usr/local/pgsql/src/backend/utils'
make: 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_tuu;
^
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: *** Error 1 564880 发表于 2023-7-1 22:30
这个试过了,也是不行,用的是宝塔PostgreSQL管理器 2.0
您好,复制下面的命令去执行,执行成功后再去make试试
sudo yum install libuuid-devel 本帖最后由 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 &&emake install
希望官方把这个 --with-uuid=e2fs给加上,免得出现各种操蛋问题,耽误我半天时间
堡塔运维小林 发表于 2023-7-1 22:51
您好,复制下面的命令去执行,执行成功后再去make试试
sudo yum install libuuid-devel ...
希望安装pgsql的命令中把这个 --with-uuid=e2fs给加上,看下我下面的回复 为啥我按照上面的操作还是无法创建
CREATE EXTENSION IF NOT EXISTS uuid-ossp;
宝塔pgsql管理器2.6安装的pgsql16.1版本
页:
[1]