Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
The best type for PostgreSQL text type
Whats the best c++ or Qt type for represent a text type column of postgresql?
A text type in postgresql supports an unlimited number of characters (unlimited string).
Or should I treat it as a text file?
What about QString ?
Is there a character limit for QString?
mcosta last edited by
QStringis a 32bit integer so, in theory the maximum size is
@Exotic_Devel How long are the strings going to be?
TheBadger last edited by
I always use QString without any issues
@jsulm There isn’t a size definition, since text type in PostgreSQL is unlimited. But I believe that QStrint limit (2^31-1) will not be exceeded.
@Exotic_Devel The question is: how big will your strings be? Are you really going to store strings > 2^31-1 ?
If not then you can just use QString. Just because a string in PostgreSQL is (theoretically) unlimited does not mean that you have to use a string implementation which has an unlimited size.