Linked Postgres Server ON MS SQL 2005

Hi All

I have a linked server configured for a Postgres server on my MS SQL 2005 server. I use this server quite often to receive data for queries and reports but the server response is to slow and need an alternative solution. The ODBC provider I'm using is PGNP on the linked server. I thought of using openrowset so I could only return the data I need but not sure how to specify the IP Address, Port number, username or password. Please could anyone help. To query the linked server currently I use SELECT * FROM [LinkedServer].[DatabaseName].[Public].[tablename] WHERE (Statement)

more ▼

asked Sep 21, 2010 at 06:07 AM in Default

avatar image

33 3 2 5

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You would use something along these lines:

 SELECT * FROM OPENROWSET('ProviderName', 'ConnectionString', 
                          'SELECT * FROM [DatabaseName].[Public].[tablename] 
                           WHERE (Statement)')

You then would need to substitute ProviderName and ConnectionString with the relevant details for your PostGres client. I am not sure what they are though. However, this page has some good examples.

more ▼

answered Sep 21, 2010 at 06:17 AM

avatar image

Matt Whitfield ♦♦
29.5k 62 66 88

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Sep 21, 2010 at 06:07 AM

Seen: 2760 times

Last Updated: Sep 21, 2010 at 06:07 AM

Copyright 2018 Redgate Software. Privacy Policy