• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

PostgreSQL Insert data problem

Zarez

New Member
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 :(

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

  • 1608281929763.png
    1608281929763.png
    11.6 KB · Views: 4
Last edited:
Top