Open martinamuscariello opened 7 years ago
give permission to the user who is using the foreign server -- pg_authid and pg_user_mapping
grant all on pg_authid to user; grant all on pg_user_mapping to user; i.e user= postgres_user
I've already given permissions to the user on the foreign server.
I add 'tds_version' option to foreign server, but I still have the same problem.
I try to set up a sql server connection through tds_fdw I execute the following code
CREATE EXTENSION tds_fdw
CREATE SERVER box_svr FOREIGN DATA WRAPPER tds_fdw OPTIONS (servername 'myserver', msg_handler 'notice');
CREATE USER MAPPING FOR postgres SERVER box_svr OPTIONS (username 'postgres_user', password 'my_pwd');
CREATE FOREIGN TABLE dbo.azioni ( id_azione integer, descrizione_azione character varying ) SERVER box_svr OPTIONS (query 'SELECT * FROM dbo.Azioni');
But when I try to select from foreign table , I get the following error message:
select * from dbo.azioni
ErrorCode: -2147467259 Severity: ERRORE, Code: HV00L, Line: 3860, Position: ErrorMessage: DB-Library error: DB #: 18488, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 14
Could you help me to understand what I'm doing wrong? Thanks in advance.