views:

139

answers:

2

Is there a better data type to be using to store a zlib compressed string in Postgresql?

+2  A: 

Use a bytea. Zip compressed data is not a text.

halfdan
Citing sources last updated 8 years ago when up to date and authoritative sources exist is probably more confusing than helpful.
Milen A. Radev
`bytea` , as by other answer, is what corresponds, in Postgresql, to the BLOB concept.
leonbloy
+4  A: 

Use bytea "The bytea data type allows storage of binary strings"

nos
Interesting. Any idea what this would be in Django? Meaning what Django field type would yield this type in Postgres?
Rhubarb
Apparently django doesn't support bytea directly - see http://stackoverflow.com/questions/517349/binaryfields-in-django-models , You could e.g. base64 encode your data and continue to use a text field - though you'd lose some of the benefit of compression
nos