W Wojtekbut New Member Jan 28, 2022 #1 I have timestamp column in my postgres db. When I want insert record, there is an error: "PSQLException: ERROR: syntax error at or near $2" This is my sql: INSERT INTO table (name, "date") VALUES (?, TIMESTAMP ?) Column type: name - varchar, date - timestamp
I have timestamp column in my postgres db. When I want insert record, there is an error: "PSQLException: ERROR: syntax error at or near $2" This is my sql: INSERT INTO table (name, "date") VALUES (?, TIMESTAMP ?) Column type: name - varchar, date - timestamp
Solution W W Wojtekbut Jan 28, 2022 I've got a solution. It seems that TIMESTAMP accept only literals. It should be: INSERT INTO table (name, "date") VALUES (?, ?::timestamp) or timestamptz - with time zone
I've got a solution. It seems that TIMESTAMP accept only literals. It should be: INSERT INTO table (name, "date") VALUES (?, ?::timestamp) or timestamptz - with time zone
W Wojtekbut New Member Jan 28, 2022 #2 I've got a solution. It seems that TIMESTAMP accept only literals. It should be: INSERT INTO table (name, "date") VALUES (?, ?::timestamp) or timestamptz - with time zone Upvote 0 Solution
I've got a solution. It seems that TIMESTAMP accept only literals. It should be: INSERT INTO table (name, "date") VALUES (?, ?::timestamp) or timestamptz - with time zone