ZappySys provides high performance drag and drop connectors for PostgreSQL Integration. In this post you will see how to Export PostgreSQL Table Data to SQL Server Table using SSIS PostgreSQL Source. PostgreSQL Source supports SQL language to query PostgreSQL data. PostgreSQL is a powerful, open source relational database with strong reputation for reliability, feature robustness, and performance.
In nutshell, this post will focus on how to read PostgreSQL Table Data and write into SQL Server table in few clicks.
Prerequisite
- First, you will need to have SSIS installed
- Secondly, make sure to have SSDT
- Thirdly, You have obtained PostgreSQL Credential.
- Finally, do not forget to install ZappySys SSIS PowerPack
Components Mentioned in this article
What is PostgreSQL?
PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads. The origins of PostgreSQL date back to 1986 as part of the POSTGRES project at the University of California at Berkeley and has more than 30 years of active development on the core platform.
PostgreSQL has earned a strong reputation for its proven architecture, reliability, data integrity, robust feature set, extensibility, and the dedication of the open source community behind the software to consistently deliver performant and innovative solutions. PostgreSQL runs on all major operating systems, has been ACID-compliant since 2001, and has powerful add-ons such as the popular PostGIS geospatial database extender. It is no surprise that PostgreSQL has become the open source relational database of choice for many people and organisations.
Getting started with using PostgreSQL has never been easier – pick a project you want to build, and let PostgreSQL safely and robustly store your data.
Download and Install PostgreSQL
Please go to below download link and download the Windows version Binary package and install it and follow the steps from the installer.
https://www.postgresql.org/download/
Create PostgreSQL Database and Table
- To do this, we will first open the pgAdmin Panel.
- It will open the pgAdmin Panel in the browser. Select Server and Right click on Databases to create database.
- Enter the Database name and click on Save to create it.
- Now select the created database under it expand Schemas and right click on Tables and click on create Table.
- Now enter the table name and go to columns tab.
- Add the columns by clicking add button and give the desire column name and select the datatype for the same.
- Now, let’s insert some data using Query Editor.
- That’s it, now let’s move forward to read the data from this table using SSIS PostgreSQL Source in the next the section.
Getting Started
In order to start, we will show several examples. ZappySys includes an SSIS PostgreSQL Source that will help you extract large amount of data from a PostgreSQL Database. PostgreSQL Source supports Multiple modes (i.e. Table or Query) to read data from PostgreSQL Database and many more operations. Here we are showing you is, How to read data from PostgreSQL collection.
You can connect to your PostgreSQL database by entering your PostgreSQL credentials.
Configure PostgreSQL Source to read data from the table
Let´s start with an example. In this SSIS PostgreSQL Source Task example, we will load the PostgreSQL table data to SQL Server.
- First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
- Drag and Drop PostgreSQL Source Task from the SSIS Toolbox and double click on it to edit it.
- Let’s create a connection for PostgreSQL Database.
- Let’s select the Table mode and select the table and click on preview.
- You can also use the query mode to filter the data and do more operation using query. You can find our several Examples also by clicking on <<View Examples>>.
- That’s it we are ready to load PostgreSQL Table data to SQL Server.
Load PostgreSQL Table data into SQL Server
- Inside Data Flow, Drag and drop Upsert Destination Component from SSIS Toolbox
- Connect our Source component to Upsert Destination
- Double click Upsert Destination to configure it
- Select Target Connection or click NEW to create new connection Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS
- Select Target Table or click NEW to create new table based on source columns
- Click on Mappings Tab to Auto map columns by name. You can change mappings as you need SSIS Upsert Destination - Columns Mappings
- Click OK to Save Upsert Destination Settings
- That's it, You are now ready to run data flow. NOTE: If you wish to debug data flow and see records when you run, add data viewer by right click on blue arrow > Click Enable Data Viewer
- To execute data flow, Right click anywhere inside Data Flow Surface and click Execute Task
Conclusion
Above all, in this blog, we learned how to Read data from PostgreSQL in SSIS. We used SSIS PostgreSQL Source to read the data from PostgreSQL Table and load data into SQL Server Table. You can download SSIS PowerPack here to try many other scenarios not discussed in this blog along with 70+ other components.
References
Finally, you can use the following links for more information: