Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/15/2016 05:55 PM, John DeSoi wrote:

On Nov 10, 2016, at 12:55 AM, Cynthia Hombakazi Ngejane <hombakazi.ngejane@xxxxxxxxx> wrote:

I have two databases SQLlite and Postgres,  SQLite is my local database in it I am saving fingerprint templates that get capture on site (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.

It is going to be hard to help without seeing the exact code you are using to insert and the exact error message you are seeing.

Part of the issue is that BLOB in SQLite does not actually mean anything:

http://sqlite.org/datatype3.html

"(Historical note: The "BLOB" type affinity used to be called "NONE". But that term was easy to confuse with "no affinity" and so it was renamed.) "

....

"A column with affinity BLOB does not prefer one storage class over another and no attempt is made to coerce data from one storage class into another."

So you can stick anything you want in there, which actually is true of any SQLite 'type'. So the OP is going from inserting into something(SQLite) that does no input validation to one(Postgres) that does.


John DeSoi, Ph.D.





--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux