【发布时间】:2015-04-23 11:58:40
【问题描述】:
我想执行这个查询。
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
问题是我现在无法更改数据库(我没有时间)所以我需要构建一个查询来“完成”这项工作(尽管这个数据库需要使用 DROP DATABSE 进行规范化.. .)
我的代码有什么问题?也许我错过了一些明显的东西,但我疲惫的头脑只是跳过它。
【问题讨论】:
标签: arrays database postgresql insert pg