Sync Postgresql with sql 2012 LocalDB RRS feed

  • Question

  • Hi, 

    i am currently write a App in C# with a PostgreSql Database.

    So some Employees need to work local. So i decided to use a LocalDB. 

    I am using Devart dotConnect PostgreSql v7.3.201 which include a SyncFramework.

    So i can Sync two PostgreSql Databases and that works very fine.

    Now i want to sync the PostgreSql with the LocalDB. The Problem is that Provisioning throw an Exception the column int4 could not created. 

    Is there a Workaround to change the datatypes or is that not possible?

    Thomas Heinze 

    Thursday, November 13, 2014 5:57 PM


  • So i´ve got a Solution from Devart Forum.

    First i've to create the table an then i have to scope to the LocalDb.

    And then it works very simple.

    PgSqlConnection serverConnection = new PgSqlConnection();
    serverConnection.ConnectionString = "PostgreSQL connection string";
    SqlConnection clientConnection = new SqlConnection();
    clientConnection.ConnectionString = "SQL Server connection string";
    DbSyncScopeDescription scopeDescription = new DbSyncScopeDescription("ResultsScope");
    DbSyncTableDescription tableDescription = PgSqlSyncDescriptionBuilder.GetDescriptionForTable("RESULTS", serverConnection);
    PgSqlSyncScopeProvisioning serverProvision = new PgSqlSyncScopeProvisioning(serverConnection, scopeDescription);
    DbSyncScopeDescription scopeDescription2 = new DbSyncScopeDescription("ResultsScope2");
    DbSyncTableDescription tableDescription2 = SqlSyncDescriptionBuilder.GetDescriptionForTable("RESULTS", clientConnection);
    SqlSyncScopeProvisioning clientProvision = new SqlSyncScopeProvisioning(clientConnection, scopeDescription2);
    SyncOrchestrator syncOrchestrator = new SyncOrchestrator();
    syncOrchestrator.RemoteProvider = new PgSqlSyncProvider("ResultsScope", serverConnection, null, null);
    syncOrchestrator.LocalProvider = new SqlSyncProvider("ResultsScope2", clientConnection, null, null);
    PgSqlSyncScopeDeprovisioning deprovision = new PgSqlSyncScopeDeprovisioning(serverConnection);
    SqlSyncScopeDeprovisioning deprovision2 = new SqlSyncScopeDeprovisioning(clientConnection);

    • Marked as answer by JuneT Tuesday, November 18, 2014 2:13 AM
    Friday, November 14, 2014 3:57 PM