Querying a PostGres View from SQL Server

  • mradams
  • Topic Author
  • Visitor
  • Visitor
8 years 7 months ago #11160 by mradams
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
8 years 7 months ago #11161 by Moderator
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.

  • mradams
  • Topic Author
  • Visitor
  • Visitor
8 years 7 months ago #11163 by mradams
Replied by mradams on 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.048 seconds
Powered by Kunena Forum