- Download Postgres ODBC driver from http://www.postgresql.org/ftp/odbc/versions/msi/
- Install above ODBC drivers
- Create system DSN ... On windows XP > Control Panel > Administrative Tools > Data Sources (ODBC)
- Go to System DSN Tab > Add > Select PostgresSQL Unicode sriver > Finish
- On Prompted page add
Database - Name of postgres database
Server - Name of Postgres server
Port:5432 (or whatever you database port is..)
Username and Password: Enter postgres database username /password you wish to use
Test the System DSN by clicking on Test
- Create Linked Server on SQL Server 2008/2005 to connect to postgres database
Connect to SQL server instance where who wish to create linked server
Go to ServerObject > linked Servers > New Linked Server
Fill the Linked server properties
Select Provider: Microsoft OLEDB Provider for ODBC Drivers
Product name: postgres (you can put whatever you like)
Data Source: Name of System DSN created in last step
Right click Linked Server and Test Connection
Now you query postgres from SSMS by something like