Is there any reason why databases cannot have a binary formatted datatype?

Started by Andrew Macleanover 16 years ago3 messagesgeneral
Jump to latest
#1Andrew Maclean
andrew.amaclean@gmail.com

Can't we have a data type called say "image" that is just a
representation of the bytes and nothing else?
It seems to me that bytea is a hangover from the old days.

Is there some underlying physical reason why postgresql and other
databases cannot handle binary data without going through all this
silly escape stuff which must have a massive impact on performance. Or
is it just because databases originally were built to handle just test
data?

Let's have a good discussion on this and perhaps an outcome for easier
handling of binary data.

I have a reason for this. I want to be able to easily store maps and
programs that are transmitted to devices in the field.

Regards
Andrew

--
___________________________________________
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney 2006 NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___________________________________________

#2John R Pierce
pierce@hogranch.com
In reply to: Andrew Maclean (#1)
Re: Is there any reason why databases cannot have a binary formatted datatype?

Andrew Maclean wrote:

Can't we have a data type called say "image" that is just a
representation of the bytes and nothing else?
It seems to me that bytea is a hangover from the old days

um, thats what BYTEA is.

Is there some underlying physical reason why postgresql and other
databases cannot handle binary data without going through all this
silly escape stuff which must have a massive impact on performance. Or
is it just because databases originally were built to handle just test
data?

thats all in the API's you use to access the database. you can pass in
binary data directly without escaping if your API bindings support
parameterized calls, like pqExecParams()

#3Richard Huxton
dev@archonet.com
In reply to: Andrew Maclean (#1)
Re: Is there any reason why databases cannot have a binary formatted datatype?

Andrew Maclean wrote:

Is there some underlying physical reason why postgresql and other
databases cannot handle binary data without going through all this
silly escape stuff which must have a massive impact on performance. Or
is it just because databases originally were built to handle just test
data?

What John said, but just a small note. The text representation of the
various datatypes are fairly static. The binary representations can
change - even between two databases with the same version number
(floating-point vs big-int timestamps). For a meaningless (to the db)
"blob" type that doesn't matter, but you will need to be aware of the
issues and have appropriate tests in place for your application.

--
Richard Huxton
Archonet Ltd