tp5 No function matches the given name and argument types. You might need to add explicit type cast

tp5连接pgsql数据库 报错

第一个错误 Array and string offset access syntax with curly braces is deprecated

修改一处代码

文件所在:thinkphp\library\think\db\Query.php

// 按照字段的首字母的值分表
$seq = (ord($value{0}) % $rule['num']) + 1;


改为下面的
$seq = (ord($value[0]) % $rule['num']) + 1;

改过后继续报错 继续解决: 

 No function matches the given name and argument types. You might need to add explicit type casts.或者没有匹配指定名称和参数类型的函数. 您也许需要增加明确的类型转换问题

这种问题 我之前遇到过 在次遇到还是不会 我之前文档就可以完美解决这个问题

链接:tp5支持pgsql数据库_qq5201314wx的博客-CSDN博客

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"HINT: No function matches the given name and argument types. You might need to add explicit type casts." 这个错误提示意味着在数据库中没有与给定的函数名和参数类型匹配的函数。解决这个问题的方法是添加显式的类型转换。 一种解决方案是使用uuid_generate_v4()函数的扩展。根据引用和引用的内容,可以看出在honeydb数据库中,uuid_generate_v4()函数不存在。要解决这个问题,您需要添加uuid-ossp扩展。可以使用以下命令来添加扩展: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; 另一种解决方案是在没有扩展的情况下生成UUID。根据引用的内容,可以使用以下SQL语句生成UUID: SELECT uuid_in(md5(random()::text || clock_timestamp()::text)::cstring); 这将返回一个生成的UUID。 所以,您的问题的解决方法是添加uuid-ossp扩展或使用上述SQL语句来生成UUID,并根据需要进行类型转换。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [PostgreSQL | 生成UUID 报错:HINT: No function matches the given name and argument types](https://blog.csdn.net/qq_25112523/article/details/110134090)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [在Postgres中为插入语句生成UUID?](https://blog.csdn.net/asdfgh0077/article/details/106916483)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值