"Specified cast is not valid" for any query to on-premises Postgres RRS feed

  • Question

  • Hi everybody,

    I'm trying to implement a simple pipeline to copy a table from on-premises Postgres to Azure SQL DB. I use Data Copy activity wizard for that. I've successfully installed Data Management Gateway, activity wizard can connect to it and displays the list of tables in Postgres database.

    However, whichever table or custom query I use, "Preview" tab in <g class="gr_ gr_470 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="470" id="470">activity</g> wizard returns this:


    Error when processing request: 'Type=Microsoft.Data.Mashup.InternalMashupException,Message=We&apos;re sorry&#44; an error occurred during evaluation.,Source=Microsoft.Data.Mashup,''Type=Microsoft.Mashup.Evaluator.Interface.ErrorException,Message=Specified cast is not valid.


    I don't use any exotic data types, just varchars and ints. I get the same error even for simplest queries like "select 1 as ID". If I ignore this preview error and create pipeline up to the end, it fails with the same error, so that's not a UI-only issue.


    • Postgres 9.6 at 64bit Windows 10 host. 
    • <g class="gr_ gr_92 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="92" id="92">npgsql</g>
    • Azure Data Factory

    Could you please advice what can be done to overcome this issue?

    Thanks in advance,


    Thursday, June 29, 2017 11:38 AM

All replies

  • Hi Rodion

    I have encountered the exact same issue. 

    Have you found a solution this problem ? 

    Kind Regards


    Thursday, July 13, 2017 8:20 AM
  • Hi Prash,

    no, found no solution or workaround for this. My project was a kind of investigation, so I've just made a note of this issue

    Best regards,


    Wednesday, July 19, 2017 12:49 PM
  • Could you please try the driver version 3.2.x or lower? The data engine might be incompatible with later versions.
    Tuesday, August 1, 2017 8:55 AM