How to connect postgresql database through ODBC driver in excel

Postgresql has ODBC driver "psqlodbc" which will be used to connect to postgresql databases.
In this post, we are connecting to postgresql from excel using ODBC driver. 

Step1: Verifying the existing ODBC driver in windows (both 32 and 64 bit driver) for availability of postgresql driver. 

32-bit driver, we noticed that there is no postgresql driver in the drivers list (Name column values doesn't start with Postgres text).






64-bit driver, we noticed that there is no postgresql driver in the drivers list (Name column values doesn't start with Postgres text). 




Step2: Checking the current postgresql server version, to get the corresponding psqlodbc driver. As per below screen shot, current version is "10.10". i will try to get and install psqlodbc of 10.10 version.






Step3: When check the psqlodbc driver (https://www.postgresql.org/ftp/odbc/versions/msi/), i have found the, psqlodbc_10_3 is the last version that was available for version 10. Hence, i have found 32-bit of this version, because excel is 32-bit application, thought that it would be good to have 32-bit psqlodbc driver.




Step4: After extract the zip file found the below files in folder. 




Step6: I have started installation, by double clicking the "msi" file. Below are the installation steps. 








Step7: Once after the installation, i am again verifying the ODBC driver (both 32 and 64 bit) for the postgresql drivers.

32-bit, you can find the postgresql entries in drivers list this time.




64-bit, we can't find the postgresql entries in drivers list, because as we have installed 32-bit, it's not showing here.




Step8: We are creating now the System DSN, with the postgresql database details like DB Name, username, password and others. This DSN Will be used in excel for connecting. 






Step9: Now creating a table, inserting data init in postgresql.



Step10: Below is the process in excel to retrieve the data. 






Comments

Popular posts from this blog

Postgresql System files and their uses