Thank you for your answer.
>> Example of code is:
> > session sql ( soci::postgresql, "dbname=zzzzz user=yyyyy password=xxxxx"
> > ); sql <<"create table soci_test ( id integer, img oid)";
> > sql << "insert into soci_test(id, img) values(7, lo_creat(-1))";
> > sql.begin();
> > {
> >     blob b(sql);
> >     sql << "select img from soci_test where id=7", into(b);
> > }
> >
> > This code works with soci 2.2 and not soci 3.0.
>
> Interesting. As I see in comments to the test3() in PostgreSQL tests the
> BLOB operations have to be within a transaction block.
Indeed but changing 
        sql.begin();
into
        transaction tr(sql);
does not solve my problem.

> The file is src/backends/postgresql/test/test-postgresql.cpp.
> I have just re-run all tests with PostgreSQL and they passed OK.
A colleague of mine reprodured the same failure as me on his x86_64 
architecture. I point this because I think this is the source of my issues. 
Does your architecture 64 bits?

In fact, the message "Cannot convert data." comes from the template function 
string_to_integer into the file src/backends/postgresql/common.h
Indeed, at the point the value of  static_cast<long long>(max)  is -1.
I guess this is is because of the -Wno-long-long compilation option  (that is 
unfortunately no straightforward to remove).

This analysis is reinforced by the fact that all the (common) tests fail when 
it tries to manage 'unsigned long' variables. As well, I noticed that the oid_ 
of large objects (into postgresql_blob_backend) are themselves unsigned long. 
That may explain my initial problems with blob management.

I continue to investigate this point, but I would appreciate any feedback.

Regards

HLB


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to