PSQL [error] - value being recognized as a column

微笑、不失礼 提交于 2021-02-04 21:36:34

问题


I just started learning database a couple of days ago. I'm running into this problem where my value is being recognized as a column, and it's spitting out an error.

This is my News table:

id | bodyText | url |  createdAt | updatedAt 
----+----------+-----+-----------+-----------

this is the command I ran in psql:

INSERT INTO "News" ("bodyText") VALUES ("this is a test");

and this is the error I'm getting:

ERROR:  column "this is a test" does not exist
LINE 1: INSERT INTO "News" ("bodyText") VALUES ("this is a ...

I've tried removing the double quotes, adding it, doing it line by line, and so far I haven't come across an answer. Does anyone have an answer to this? Thanks in advance.


回答1:


Try this:

INSERT INTO "Notifications" ("bodyText") VALUES ('this is a test');


来源:https://stackoverflow.com/questions/44898665/psql-error-value-being-recognized-as-a-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!