神剑山庄资源网 Design By www.hcban.com
最近才接触到一个用PostgreSQL的项目,然后在开发的过程中发现了这样的一个问题。
错误: 操作符不存在: character = integer
反正还有很多报错的,原因都是类型的转换问题。在mysql中似乎对类型这个概念不是那么敏感,而在PostgreSql中Integer 、Long、Date、String 等等之间转换都会存在操作符不存在的报错。
所以在使用非实体进行数据传输的时候,例如Map等等就需要手动设置数据类型。
Long orgId = (maps.get("orgId") != null && maps.get("orgId").toString().length() > 0) "orgId").toString()) : null; maps.put("orgId", orgId);
就可以利用maps进行判断后再进行插入修改等操作,Date格式也同理。
补充:PostgreSQL一些简单问题以及解决办法
问题:
org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
解决办法:
Edit /var/lib/pgsql/data/postgresql.conf file Change #listen_addresses = 'localhost' to listen_addresses = '*'
问题:
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "<host_ip>", user "fkong", database "fkong", SSL off
解决办法:
Edit /var/lib/pgsql/data/pg_hba.conf file Add below line under "# IPv4 local connections:" "host all all <host_ip>/32 password"
问题:
org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "fkong"
解决办法:
Edit /var/lib/pgsql/data/pg_hba.conf file Change "host all all <host_ip>/32 ident" to "host all all <host_ip>/32 password"
以上为个人经验,希望能给大家一个参考,也希望大家多多支持。如有错误或未考虑完全的地方,望不吝赐教。
神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com
暂无PostgreSQL报错 解决操作符不存在的问题的评论...
更新日志
2024年10月18日
2024年10月18日
- 群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
- RiffKitten-ChaosParade(2024)[24-44,1]FLAC
- RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
- 赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【南方】【WAV+CUE】
- 群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+CUE】
- 张宇.1999-雨一直下【EMI百代】【WAV+CUE】
- 袁娅维.2021-月亮失眠了(DELUXE)【华纳】【FLAC分轨】
- AlanBroadbent-JazzFunk(2024)[24-44,1]
- 梅艳芳《绝代芳华》开盘母带[低速原抓WAV+CUE]
- ABC唱片-《外国精逊母带直刻神奇黑胶[APE+CUE].
- 群星《天赐的声音第五季 第6期》[320K/MP3][101.43MB]
- 群星《天赐的声音第五季 第6期》[FLAC/分轨][526.16MB]
- 群星《说唱梦工厂 第2期》[320K/MP3][96.37MB]
- 杨宗宪.1994-留你留袂着【有容唱片】【WAV+CUE】
- 李翊君.2005-勇敢的爱【创意唱片】【WAV+CUE】