[odb-users] Re: Help is need with odb::vector Binary Type for
PostgreSQL
Alain-Serge Nagni
asnagni at yahoo.com
Mon Dec 11 14:07:50 EST 2017
Hi Bris,
Thank you the info. I have a look.
Tell me Boris, when we load the object from the database, is there a way to not load the BLOB?
Thank you,
Alain-Serge
> On Dec 9, 2017, at 8:20 AM, Alain-Serge Nagni <asnagni at yahoo.com> wrote:
>
> Hi there,
> We have a Classe with a std::vector as a data member, std::vector<std::uint8_t> , and for performance reason we would like to migrate to odb::::vector<std::uint8_t>. Do anyone knows how to perform that switch? Per the documentation it should be a drop and replacement. We are using PostgreSQL database. We did try and we are having some issues at run time. This is the class and the data member declaration:
>
>
> #pragma db object
> Class CPhotos
> {
> ….
> ….
> ….
> ….
>
> #pragma db type (“BYTEA")
> std::vector<std::uint8_t> m_imageBytes;
> }
>
>
>
> When we change std::vector<std::uint8_t> m_imageBytes to : odb::vector<std::uint8_t> m_imageBytes;
>
>
> At run time when we try to access the database we have an error. This is the error :
>
> 42P01: ERROR: relation "CPhotos_imageBytes" does not exist
> LINE 1: ...Bytes"."index", "CPhotos_imageBytes"."value" FROM "CPhotos_i…
>
>
>
> Thank you for your help,
> Alain-Serge
More information about the odb-users
mailing list