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

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).

About array literal / array constructor:

  • Pass array from node-postgres to plpgsql function
  • How to pass custom type array to Postgres function

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)