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? -
Hi,
What about QString ?
-
Is there a character limit for QString?
-
Hi,
the
size
of aQString
is a 32bit integer so, in theory the maximum size is2^31-1
. -
@Exotic_Devel How long are the strings going to be?
-
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.
Thanks guys.
-
@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.