journeypost=# INSERT INTO user_data.user_data (username,randomint) VALUES ('mahman',1); ERROR: array value must start with "{" or dimension information LINE 1: ... user_data.user_data (username,randomint) VALUES ('mahman... journeypost=# INSERT INTO user_data.user_data (username,randomint) VALUES {'mahman',1}; ERROR: Syntax error at or near "{" LINE 1: ...O user_data.user_data (username,... journeypost=# INSERT INTO user_data.user_data (username,randomint) VALUES (2,{'mahman',1}); ERROR: Syntax error at or near "{" LINE 1: ...ser_data.user_data (username,...
在Postgresql中,上述不同的INSERT语句失败了.我做错了什么?
编辑:
我的架构:
journeypost=# \dt user_data.* List of relations Schema | Name | Type | Owner -----------+-----------+-------+------- user_data | user_data | table | user (1 row)
我的桌子:
journeypost=# \d user_data.user_data Table "user_data.user_data" Column | Type | Modifiers -----------+-------------------------+----------- username | character varying(50)[] | not null randomint | integer | Indexes: "UsernameUnique" PRIMARY KEY,btree (username)