PostgreSQL not inserting data
So i have a bot that inserts data about files to a db that are uploaded to backblaze through it.
I use postgre to keep track.
im using psycopg2, and using the simple query:
This should be correct according to the psycopg2 docs.
When i run the command, all goes well. The file is uploaded, the link for the file is returned, and no errors are printed. However when i check the table its empty?
I tried running the query on railway, in the little tab for it, and it ran with no errors.
What is interesting though is that the ID, which is a serial autoincrement field, was
3
, meaning something was caught by the db, but the table was still empty. nothing was ever in the table.
Im scratching my head at this.
Project ID: 45ce4783-9560-4cd6-9fe7-8982bd5ab4346 Replies
Project ID:
45ce4783-9560-4cd6-9fe7-8982bd5ab434
oh forgot to add that when i ran the query on railways tab, it did insert it into the table
thats how i saw the serial ID and stuff
but before that i never caught anything
checked the logs and found this:
but i still dont understand
how do i mark as solved
I'd also suggest posting how you fixed it so others can find it. 🙂
Solution
by not being silly and commiting ur changes to sql
CURSOR.connection.commit()
if you use psycopg2.
lol