Thread: Syncing Data of data type BLOB into Postgres- Bytea

Syncing Data of data type BLOB into Postgres- Bytea

From
Cynthia Hombakazi Ngejane
Date:


Hello,

I have two databases SQLlite and Postgres,  SQLite is my local database in it I am saving fingerprint templates that get capture onsite (i.e offline) and my column is of type BLOB. Now I want to sync these templates into Postgres (to the server), so I created a column of type bytea but Postgres is refusing to take BLOB it says there was a syntax error. I am using Qt c++ 5.7  application  to do the syncing.

Please Help...

CH Ngejane


Re: Syncing Data of data type BLOB into Postgres- Bytea

From
Adrian Klaver
Date:
On 11/09/2016 11:35 PM, Cynthia Hombakazi Ngejane wrote:
>
>
> Hello,
>
> I have two databases SQLlite and Postgres,  SQLite is my local database
> in it I am saving fingerprint templates that get capture onsite (i.e
> offline) and my column is of type BLOB. Now I want to sync these
> templates into Postgres (to the server), so I created a column of type
> bytea but Postgres is refusing to take BLOB it says there was a syntax
> error. I am using Qt c++ 5.7  application  to do the syncing.

What version of Postgres?

What is the syntax error?

What is the code you are using to insert/update the data into Postgres?

>
> Please Help...
>
> CH Ngejane
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Syncing Data of data type BLOB into Postgres- Bytea

From
Adrian Klaver
Date:
On 11/13/2016 11:40 PM, Cynthia Hombakazi Ngejane wrote:

Please reply to list also.
Ccing list.

> 9.3
> it just says syntax error near (

Can you show the actual complete error?

> I have a variable QByteArray that stores the fingerprint data, then:
> I am using QString Query = "insert into tableName(colName) values
> (:valName)";

What is the actual value of :valName?

In other words is it the raw value or has it been escaped per here:

https://www.postgresql.org/docs/9.3/static/datatype-binary.html

> prepare the query;
> then query.bindValue;
>
> lastly query.exec();
>
> On 10 November 2016 at 16:31, Adrian Klaver <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
>
>     On 11/09/2016 11:35 PM, Cynthia Hombakazi Ngejane wrote:
>
>
>
>         Hello,
>
>         I have two databases SQLlite and Postgres,  SQLite is my local
>         database
>         in it I am saving fingerprint templates that get capture onsite (i.e
>         offline) and my column is of type BLOB. Now I want to sync these
>         templates into Postgres (to the server), so I created a column
>         of type
>         bytea but Postgres is refusing to take BLOB it says there was a
>         syntax
>         error. I am using Qt c++ 5.7  application  to do the syncing.
>
>
>     What version of Postgres?
>
>     What is the syntax error?
>
>     What is the code you are using to insert/update the data into Postgres?
>
>
>         Please Help...
>
>         CH Ngejane
>
>
>
>
>     --
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Syncing Data of data type BLOB into Postgres- Bytea

From
Adrian Klaver
Date:
On 11/13/2016 11:40 PM, Cynthia Hombakazi Ngejane wrote:
> 9.3
> it just says syntax error near (
> I have a variable QByteArray that stores the fingerprint data, then:
> I am using QString Query = "insert into tableName(colName) values
> (:valName)";
> prepare the query;
> then query.bindValue;
>
> lastly query.exec();
>

On my last post I never did get to the point I was trying to make, that
this this may be a string escaping issue. To help with identifying the
problem it would be good to know the value of:

standard_conforming_strings

in postgresql.conf and whether it is commented out or not.



--
Adrian Klaver
adrian.klaver@aklaver.com