2

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#

9
  • "I have to synchronize local server tables to master server." — why not use replication. (Also, upgrade that Postgres install. That version is no longer maintained for security.) Commented Nov 11, 2013 at 20:03
  • Thanx for your reply but you must know that company doesnot want to switch to other version they ate very dumb.if you have a good suggestion for replication.let me.know we have 10 gates each has local server running and it my sync application.sync data to central and some time the local server sync from master to insert and update the local so its a two way syncrhonize ... Commented Nov 11, 2013 at 20:08
  • postgresql.org/docs/8.2/static/high-availability.html Commented Nov 11, 2013 at 20:20
  • Which one should i adopt Commented Nov 11, 2013 at 20:28
  • PostgreSQL 8.2 ? Seriously? Are you using nPgSQL? Something else? Commented Nov 12, 2013 at 1:31

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.