gpt4 book ai didi

PostgreSQL + IntelliJ : FATAL : role xxx doesn't exist

转载 作者:行者123 更新时间:2023-11-29 11:36:47 25 4
gpt4 key购买 nike

我能够连接 psql 并做我想做的事,而不是在 IntelliJ 中。

PostgreSQL version : postgres (PostgreSQL) 9.6.1
IntelliJ version : 2016.3.1

IntelliJ 配置:

URL : jdbc:postgresql://localhost:5432/sample
User : sample
Pwd : sample

测试连接:成功

所以,我连接(出现红色方 block )然后尝试一个简单的查询:

select 1;

我得到了错误:

FATAL : role 'xxx' doesn't exist`

为什么 IntelliJ 不使用我的配置中指定的角色,而是想使用我的个人登录??无论我使用什么角色,仍然会出现同样的错误。

注意:如果我将我的系统用户名添加为角色,它会起作用,但我宁愿避免这种情况。

最佳答案

添加 LOGIN 角色属性修复问题:

ALTER ROLE sample LOGIN

文档说明:

Only roles that have the LOGIN attribute can be used as the initial role name for a database connection

但是,我可以在 CLI 中连接并做我想做的事,因为我可以在 IntelliJ 中“连接”但不进行查询,没有这个属性。欢迎提供有关此行为的更多详细信息。

关于PostgreSQL + IntelliJ : FATAL : role xxx doesn't exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41580099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com