Load binary data into a PostgreSQL database through the database_interface [closed]

asked 2012-06-20 08:37:26 -0600

flyingRobot78 gravatar image

updated 2012-06-20 11:52:35 -0600

Eric Perko gravatar image

Hello,

The database_interface package appears to provide serialization for storing data in the database as a byte array. The advanced concepts tutorial shows an example of how to read from the binary data, but not how to write to the database. Let's say I want to store a sensor_msgs::PointCloud2 or a pcl::Pointcloud to the database. How would I read/write it?

I currently have a database set up in postgres that's ready to accept the binary info as bytea data. In the database interface classes, I have:

database_interface::DBField< std::vector< char > > viewpoint_1_;

and in the constructor I have:

viewpoint_1_(database_interface::DBFieldBase::BINARY, this, "viewpoint_1", "viewpoint", true)

I think this is set up properly, but I don't know how to get the data in and out of the database. Can anyone point me in the right direction?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-03-22 13:38:39.466927