Querying a PostGres View from SQL Server

More
5 years 11 months ago #11160 by mradams
mradams created the topic: Querying a PostGres View from SQL Server
I have created three views on my company's postgres server that I would like to query using the OLEDB adapter from SQL Server via linked server. I tried using an OPENQUERY statement to reference the view, but I get an undefined table message. (see below)

SELECT *
FROM OPENQUERY (BSI,'SELECT * FROM public."BSI_AccountContainer"')

Can someone help with my syntax to see if that is an issue?

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #11161 by Moderator
Moderator replied the topic: Re: Querying a PostGres View from SQL Server
We were unable to reproduce the issue. Could you upgrade to the latest version, and see if you can reproduce the issue?

If the issue is still reproducible with the latest build, could you e-mail detailed steps to our Support address?

Thank you

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #11163 by mradams
mradams replied the topic: Re: Querying a PostGres View from SQL Server
Actually, I found out what I was doing wrong...it appears the provider utilizes views just like tables when referencing them via linked server.

By using this sort of syntax, I am able to pull the data from the views with no issue:

SELECT *
FROM "BSI"."production"."public"."BSI_AccountContainer"

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum