St.form_submit_button to update Postgres database

Started using Streamlit last week, instant fan. The app I’ve developed is very simple. I am collaborating with a group of scientists (app users) and need to have a simple platform for them to perform quality assessment (QA) review on some data. I use st.form that has some select boxes that lets users select a measurement from the project database for review. Once these options are selected, I have a st.form_submit_button that triggers the app to go get the data from the database based on the user input. It then writes out the data and makes a couple charts for them to look at, and then 2 drop down menus and a text box are provided to allow them to provide their input. A second st.form_submit_button is used to commit their input to the database.

Here’s the issue. This works perfectly in local development using an SQLite database. I updated the app to point to a Postgres database rather than my local test SQLite database. Everything still works perfectly except the second st.form_submit_button. It behaves totally differently now and does not commit anything to the database. Just to check, I put the database commit before the submit button and it commits, but only commits blanks (as if no input). For example, when put before the second submit button this successfully commits blank text ("") to the Postgres database even when there is user input:

CUR.execute("UPDATE table SET euid = ‘userinput1’ WHERE hashid = ‘userinput2’)
DBCON.commit()

While this does not commit anything to the Postgres database, clears the form (with clear_on_submit = False), and starts over without doing anything or raising any errors:

commitbutton = st.form_submit_button(label = ‘Click here to commit changes to database’)
if commitbutton:
CUR.execute("UPDATE table SET euid = ‘userinput1’ WHERE hashid = ‘userinput2’)
DBCON.commit()

Only the second st.form_submit_button is in question here. I haven’t changed anything else about the app except the database that it points to.