Cannot INSERT: ERROR: array value must start with “{” or dimension information

前端 未结 1 1435
情书的邮戳
情书的邮戳 2020-12-16 10:25
journeypost=# INSERT INTO user_data.user_data (username,randomint) VALUES (\'mahman\',1);
ERROR:  array value must start with \"{\" or dimension information
LINE 1:          


        
相关标签:
1条回答
  • 2020-12-16 11:04

    Your column username seems to be an array type, so the literal 'mahman' is not valid input for it.

    It would have to be '{mahman}':

    INSERT INTO user_data.user_data (username,randomint)
    VALUES ('{mahman}',1);
    

    (Or make it a plain varchar column or text column instead.)

    Update confirms it: character varying(50)[] is an array of character varying(50).

    0 讨论(0)
提交回复
热议问题