I have some code which calls functions in a PostgreSQL DB using SQL linked servers. When called in PostgreSQL the column name is usually the same as the function called and up until I updated to the latest version of PGOLEDB the behaviour was the same. With the latest version I know get a column name like COLUMN1. To test try the folowing:
In PostgreSQL - select version(); - you should see a column called version
In SQL Server using a linked server - select * from OPENQUERY(LINKEDSERVER,'select version()') - you should see a column called COLUMN1
I can fix this by changing the SQL Server query to the following select * from OPENQUERY(LINKEDSERVER,'select version() as version') but I'd rather not have to do that.
Version 18.104.22.16856 was the version I was using that worked as expected. Can anyone shed some light on this?