Reputation: 187
I am.programming an.application in which i am selecting data from postgres database and table name cards.
In.cards we have many columns but two.columns are bytea datatype. It has a blob saved one.column is named as tpl and other is photo but when i select data and fill datatable through dataAdapter the datable shows theese two column values as System.Byte[] and when i insert it in my master database it.insert it as System.Byte[] it is loosing.the binary data which is in the column. I have to.syncrhonize local server tables to master server . We have different gates in our company where passes are issued and.then.they are synchrinized to a central sever ..
I hope you people get my point please help
Databae is postgresql 8.2 Apllication is on.c#
Upvotes: 2
Views: 2613
Reputation: 2011
I've worked on a db system before where it used dblink connections for controlling the data transfer between postgres servers of different versions. This included transferring of bytea data and maintaining the data type. Dblink connections are a little restrictive and I can't speak for connection time overheads however they serve their purpose well for data transfer.
On the main server the data was pulled in from the satellites:
INSERT INTO main_table
SELECT * FROM dblink("connect_string", ''SELECT tpl, photo FROM satellite_table;'')
AS data(tpl bytea, photo bytea);
This allows you to specify the incoming data types specifically. Not sure if this helps but I've seen this working fine on an 8.3 db. http://www.postgresql.org/docs/8.3/static/contrib-dblink.html
Upvotes: 1