Hi,
I have a problem with my script: error: pq: value too long for type character(1)
My database is built like this:
CREATE TABLE ip_logs (
ip_id INT PRIMARY KEY,
nickname TEXT NOT NULL,
ip_adress TEXT NOT NULL);
My script:
dbc.exec("INSERT INTO ip_logs(ip_id, nickname, ip_adress) VALUES ((SELECT max(ip_id)+1 FROM ip_logs), ?, ?)", nick, ip);
and
dbc.exec("INSERT INTO ip_logs(ip_id, nickname, ip_adress) VALUES ('20', 'test', 'test')");
The second script works properly in psql console.
I searched in google but i didnt get a helpful informations
Edit 1:
I can send ... VALUES (10, 'ab', 'cd');
and this ...VALUES(10, 'abc', 'cde');
doesnt work. I noticed that i cannot send data above 2 chars. Why?
I have a problem with my script: error: pq: value too long for type character(1)
My database is built like this:
CREATE TABLE ip_logs (
ip_id INT PRIMARY KEY,
nickname TEXT NOT NULL,
ip_adress TEXT NOT NULL);
My script:
dbc.exec("INSERT INTO ip_logs(ip_id, nickname, ip_adress) VALUES ((SELECT max(ip_id)+1 FROM ip_logs), ?, ?)", nick, ip);
and
dbc.exec("INSERT INTO ip_logs(ip_id, nickname, ip_adress) VALUES ('20', 'test', 'test')");
The second script works properly in psql console.
I searched in google but i didnt get a helpful informations
SinusBot 1.0.0-beta.10-202ee4d
Ubuntu Server 20.04.1 LTS
Edit 1:
I can send ... VALUES (10, 'ab', 'cd');
and this ...VALUES(10, 'abc', 'cde');
doesnt work. I noticed that i cannot send data above 2 chars. Why?
Attachments
Last edited: