我想执行此查询。Postgres - 通过SQL插入varchar数组
INSERT INTO items (title, description,
start_date,
expiration_date,
type,
quantity,
state,
sold,
cover_photo_file_name,
cover_photo_content_type,
cover_photo_file_size,
instructions)
VALUES
(
'some_test_value',
'lorem ipsum',
'2015-01-01 00:00:00',
'2015-06-10 00:00:00',
0,
19,
0,
0,
'RackMultipart20150317-10093-1ny4gmx.gif',
'image/gif',
157574,
{"lorem ipsum\r","dolor sit\r","loremloremipsumipsum 'sitsit' dolor sit"}
);
我得到一个非常讨厌的
ERROR: syntax error at or near "{"
当我尝试做了
ARRAY["Lorem ipsum\r", ...]
我得到:
ERROR: column "Lorem ipsum" does not exist
问题是我无法改变的分贝现在(我没有时间),所以我需要吨o构建一个将“完成”作业的查询(尽管此db需要使用DROP DATABSE进行标准化...)
我的代码有什么问题?也许我错过了一些明显的东西,但我疲惫的心灵正在跳过它。
请你也可以添加你改变了什么? – Nilesh
虽然这是正确的,但我鼓励您尝试解释*为什么*和/或添加相关文档链接。 –