万年白嫖党也开始写博客了。
1、如果postgresql字段名小写,正常的增删改查。
select userid,username from users where userid = 1
2、如果postgresql字段名包含大写字母,比如驼峰型的。
2-1、查询时候需要添加引号。
select "userId","userName" from users where "userId" = 1
2-2、如果查询时候不添加引号
select userId,userName from users where userId = 1
ERROR: column “userid” of relation “users” does not exist
问题倒是不复杂,主要是用mysql时候没碰到过,记录一下。