Re:Things I wished more developers knew about databases
by tenant on Wednesday April 22, 2020 @04:22PM
(#22949774)
An odd thing that happened to me yesterday with the PostgreSQL ODBC driver (psqlODBC) v9.3.400. It wouldn't let me insert a string longer than 255 characters long into a character varying field into a local v9.4 database on windows using a recordset update. I didn't have a problem pasting it in via pgadmin. Altered the field to text and the problem went away.
I've a suspicion that there is a limit on text in the tens of thousands of characters length too though despite both those fields being essentially the same thing and limitless.
[ Parent
| on HN ]
Re:Things I wished more developers knew about databases
by echlebek on Wednesday April 22, 2020 @06:04PM
(#22950691)
That sounds like a bug in the driver. I'm pretty sure varchar on postgres is just an alias for text, which has no limit.
edit: varchar(n) will issue an error past n bytes, varchar without n is the same as text. character varying(n) is like varchar(n).