none
Postgresql-Postgresql synchronisation RRS feed

  • Question

  • Can anyone please tell me what are the changes required to make the sync sample for sql server 2005 work for postgresql to postgresql?

    I had the sync sample for SQL server and i tried to make it work for Postgresql.
    There were some problems.

    1. Since Anchor value is binary[2048] it had to be stored as 'bytea' , which when returned from database, will be of byte[4098] format. But the achor value should be byte[2048].

    2. There is a timestamp column('update_timestamp' in orders table in 'ProviderSample_local' database) in sql server which is similar to binary data and it can be compared with the binary value. But i couldn't figure how to do it in postgresql.

    Could you please help me solving these issues.
    Any code will be excellent.
    Wednesday, March 3, 2010 10:32 AM

All replies

  • Hello Manjunathmayya,

    Before making any suggestions, I have a few questions to ask.

    - Which sample are you making modifications to?

    - Which SyncFramework version are you using?

    We have a component called DbSyncProvider which lets one to supports non-MS database to synchronize.

    We also have some sample to demonstrate synchronization between Oracle server and Sql Compact clients. This requires SyncFX 2.0 DatabaseProviders

    http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3761

    Hope this helps,

    Patrick

    Friday, March 5, 2010 1:25 AM
  • I am using Sync framework 2.0 
    Sample is 'SQL Express Provider Sample'.

    The problem is the anchor value.
    It throws exception in in GetChanges method of SQLExpressClientSyncProvider.

    Exception is : System.Runtime.Serialization.SerializationException: The input stream is not a valid binary format. The starting contents (in bytes) are : 32-30-2d-30-31-2d-33-31-20-3-0-3a-30-30-3a...

    Since timestamp datatype of sql server is not present in postgresql and this is compared directly with binary colums of anchor table, i have made the sent and received anchor columns of anchor table as timestamp without time zone(which is similar to Datetime of sql server)in postgresql.

    The datetime value returned from the anchor table is converted to byte[] and is put to anchor.

    In original code, binary of 2048 is returned from anchor table. But from our conversion to byte array from datetime it becomes byte[19]. Is this causing the problem? I dont know where the problem lies.

    Thanks for the reply.
    Friday, March 5, 2010 6:26 AM