ERROR: column "..." does not exist
2007-09-30 09:15
399 查看
在PostgreSQL中,不论是在pgAdmin中还是在命令行控制台里面,在SQL语句中表示属性值的总会遇到ERROR: column "..." does not exist这样的错误,比如下面的语句:
INSERT INTO user (user_id, user_name)
VALUES (1, "Smart"); ---> 这里
会有如下出错信息:
LOG: statement: insert into user (user_id, user_name)
values (1, "NewUser");
ERROR: column "NewUser" does not exist
SQL 状态: 42703
字符:57
试验几次,发现这里改成单引号就可以了~~
INSERT INTO user (user_id, user_name)
VALUES (1, 'Smart'); ---> 这里
就可以成功插入了~ 想了想,原因可能是被双引号括起来的,PostgreSQL都会认为是“名称”,如表名,字段名等~ 而被单引号括起来的就表示值了~
INSERT INTO user (user_id, user_name)
VALUES (1, "Smart"); ---> 这里
会有如下出错信息:
LOG: statement: insert into user (user_id, user_name)
values (1, "NewUser");
ERROR: column "NewUser" does not exist
SQL 状态: 42703
字符:57
试验几次,发现这里改成单引号就可以了~~
INSERT INTO user (user_id, user_name)
VALUES (1, 'Smart'); ---> 这里
就可以成功插入了~ 想了想,原因可能是被双引号括起来的,PostgreSQL都会认为是“名称”,如表名,字段名等~ 而被单引号括起来的就表示值了~
相关文章推荐
- ERROR:column "rolcatupdate" does not exist
- ERROR:column "rolcatupdate" does not exist
- ERROR: column "..." does not exist(postgre--hibernate)
- org.postgresql.util.PSQLException: ERROR: column "loginid" of relation "userinfo" does not exist
- ERROR: relation "public.userinfo" does not exist
- ERROR:column "rolcatupdate" does not exist
- 设计表时 error: column"spclocation" does not exist
- 关于PostgreSQL数据库的 ERROR: relation "tableName" does not exist
- xcrun: error: active developer path ("..") does not exist, use `xcode-select --switch path/to/Xcode.
- MySQL编译安装的CMake Error: The source directory "/root/mysql-5.6.10/-with-ssl" does not exist.
- PostgreSql问题:ERROR: column "1" does not exist
- ERROR:column "datconfig " does not exist character
- About Derby "ERROR 42X51: The class '***' does not exist or is inaccessible. This can hap pen if the class is not public."
- navicat premium出现PostgreSQL: column “rolcatupdate” does not exist error?
- MYSQL : "THE USER SPECIFIED AS A DEFINER ('ROOT'@'%') DOES NOT EXIST"
- Postgresql: ERROR: type "double" does not exist
- ERROR:language "plpgsql" does not exist
- Python 安装Setup.py (error package directory 'src atom' does not exist)
- ERROR: type "double" does not exist
- ERROR: type "double" does not exist