I am currently using Posit Connect to host Shiny apps that pull data stored in Postgres tables. I noticed recently that Shiny apps hosted on Posit Connect only seems to display the first 255 characters of textInputArea(). It does save all characters to the database, and it is viewable when running the Shiny app locally. The data type in Postgres is text.
Is there a Posit Connect setting that I am not seeing that may be causing this? A colleague mentioned a work around is to change the type in Postgres to varchar, which is fine, but I was curious to why it would work locally but not on Posit Connect. Let me know if there is any additional information I can provide.
Interesting. Do you have an example app you can share? Is the behavior consistent across browsers? Could you share the versions of R / Shiny / Connect / Postgres that you're seeing this behavior with?
It appears to happen in both Microsoft Edge and Google Chrome (only two browsers that are installed). The areaTextInput() shows all the text when it is entered as an input, but when the details are pulled from the server, it only displays the first ~256 characters. The only other difference I can think of between running it locally vs Posit Connect is that locally we run everything on Windows vs Linux for Posit Connect. I'm not sure if that would cause the issue though. I'll see if I can replicate the issue on a non-Postgres database.
So, I think I've narrowed down the issue a bit and it's likely a difference in drivers. I'm thinking that Posit Connect's driver is different than the local one, which is causing the changes. What's strange is that it writes to the database fine, but reading is shortened to 256 characters. I hope to have more information this week.
@edavidaja Sorry it took me a few weeks to get back to you. It appears that the discrepancy comes from the difference between ODBC drivers. The local (windows) ODBC driver handles text data types differently than the professional driver on Posit Connect.
I wrote a little shiny app for testing how many characters are actually written to the database and then shown when those values are read from the db. It also allows me to switch between drivers to see how they compare. I can share the code and a docker container for the Postgres database this weekend if you're interested in checking it out.
Based on the documentation, I should be able to configure the professional driver to handle larger text lengths. For our use, it's probably best to just use RPostgres since it is more consistent across platforms.