SSIS PostgreSQL Destination
PreviousNext

PostgreSQL Destination can be used to bulk insert large amount of records to a PostgreSQL Table from any data source using SSIS. PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance

Download SSIS PowerPack

Content

Video Tutorial


Step-By-Step

In this section you will learn how to use PostgreSQL Destination Adapter to write data into the database system from Sources(SQL Server, MongoDB Source, CSV File Source etc).
  1. Download and Install SSIS ZappySys PowerPack.
  2. Firstly, You need to Download and Install PostgreSQl Server from here.
  3. For this sample exercise we will need new PostgreSQL table. Yo can use a query or create it on the pgAdmin server.
    Note: Make sure to connect the server.
    DROP TABLE IF EXISTS tbl_pg_Orders;
    CREATE TABLE public."tbl_pg_Orders"
    (
        "OrderID" character varying(50) COLLATE pg_catalog."default" NOT NULL,
        "CustomerID" character varying(50) COLLATE pg_catalog."default",
        "OrderDate" date,
        "OrderAmount" numeric,
        CONSTRAINT "tbl_pg_Orders_pkey" PRIMARY KEY ("OrderID")
    );
    					
    SSIS PostgreSQL Table - Create
  4. Once you have created the table, you may proceed to create new SSIS package. In BIDS/SSDT create new SSIS package.
  5. Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox.
    SSIS Data Flow Task - Drag and Drop
  6. Double click on the Data Flow task to see Data Flow designer surface.
  7. Here, In Visual Studio, drag and drop the DummyData Source and ZS PostgreSQL Destination in the design surface and join the components with the blue arrow.
    SSIS PostgreSQL Destination - Drag and Drop
  8. Here, you can use OLE DB Data Source, MongoDB Source, and CSV File Source.
  9. But, we are going through ZS DummyData Source for practice it and we need PostgreSQL Connection for PostgreSQL Destination.

How to create PostgreSQL Connection.

  1. Right Click in Connection Manager Panel and select [New Connection...] menu item. Pick ZS-POSTGRESQL connection type.
    SSIS Create New Connection
  2. Select ZS-POSTGRESQL Connection Manager from the Connection Managers list and Click on Add Button.
    ssis postgresql connection
  3. On New Connection Dialogbox enter connection attributes to connect to PostgreSQL instance and Click Test connection to verify credentials.

    SSIS PostgreSQL connection properties
  4. Click OK to save connection configure setting UI.

How to load data from source to PostgreSQL Destination.

  1. The Dummy Data Source is a ZappySys Task in the Data Flow that can be used to generate testing data.
  2. Double click DummyData Source to configure it.
  3. From Template pick Orders and enter row count=100.
    Configure SSIS Dummy Data Generator Source
  4. Click OK to save DummyData source configure setting UI.
  5. Now on double click PostgreSQL Destination to configure it.
  6. Lets configure PostgreSQL Destination, In the Connection Manager tab, select PostgreSQL Connection we have created before.
    SSIS PostgreSQL Destination - Connection Manager
  7. In the Component Properties, set destination Table from TableName dropdown list.
    SSIS PostgreSQL Destination - Component Properties
  8. Click on Mappings tab and verify mapping. If target table is new table and its empty then all input columns will be automatically mapped as shown below. If table is existing table with some data then you can manually pick mapping columns by dragging it from source list to target list.
    SSIS PostgreSQL Destination - Columns Mapping
  9. Click OK to save settings.
  10. Execute the package and verify target data in the pgAdmin to view data.
    SSIS PostgreSQL Destination - Execute

Properties

Property Name Description
LoggingMode LoggingMode determines how much information is logged during Package Execution. Set Logging mode to Debugging for maximum log.

Available Options

Option Description
Normal Normal is the lowest level of detail logged
Medium Medium provides more information than normal, but less than detailed
Detailed Detailed provides more detail than the medium option, but less than debugging
Debugging Debugging is the maximum level of detail logged
PrefixTimestamp When you enable this property it will prefix timestamp before Log messages.
LocalID Specifies the locale that the component uses to interpret locale-sensitive data such as data and time data.
TableName The table name where you read data. This option only used when AccessMode=Table
BatchSize How many rows you want to process in each request.

Settings UI

SSIS PostgreSQL Destination - Setting UI
SSIS PostgreSQL Destination - Setting UI
SSIS PostgreSQL Destination - Setting UI
SSIS PostgreSQL Destination - Setting UI

Output Column Properties

PostgreSQL Source FAQs

See Also

References

Articles / Tutorials

Click here to see all articles for [SSIS PostgreSQL Destination] category
Load data into PostgreSQL from Excel file using SSIS

Load data into PostgreSQL from Excel file using SSIS

Introduction In this post, we will learn How to Load data into PostgreSQL from Excel file using SSIS PostgreSQL Destination. We will use SSIS PowerPack to connect PostgreSQL. This article also covers how to read Excel file in SSIS. SSIS PostgreSQL Destination can be used to perform bulk insert in PostgreSQL Table from any data source using SSIS. […]



Copyrights reserved. ZappySys LLC.