Connect to PostgreSQL as an External Data Source using PolyBase

  • Comments posted to this topic are about the item Connect to PostgreSQL as an External Data Source using PolyBase

  • It should be noted that Postgres releases their own native ODBC driver to connect, you don't have to use CData's driver.

    It can be found on their official release page here:

    https://www.postgresql.org/ftp/odbc/versions/msi/

     

    One of the trickiest and most time-consuming things about using PolyBase with Eternal Tables that use ODBC is data types and creating the External Table schema.

    I discovered an easy trick to have SQL give you baseline data types without you having to code it by hand.

    CREATE EXTERNAL TABLE [YourSchema].[YourTable_dummy] ( [dummy] INT ) WITH ( LOCATION = 'your_external_schema.your_external_table', DATA_SOURCE = your_data_source ); -- generate detected fields list

    It will then give you the schema in the Messages tab which you can use to copy/paste the columns and data types.

  • It is also important to note there is a 32-bit and 64-bit installer, you can use either of them. If it is the 64-bit version, the connection options must be 'Driver={PostgreSQL ANSI(x64)};'

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply