tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
372 stars 101 forks source link

selinux issue #161

Open zimonth opened 6 years ago

zimonth commented 6 years ago

I was struggling few hours why I couldn't get connection to work to foreign MS SQL server, until I figured and remembered Fedora is SELinux enabled system. It did not allow PostgreSQL server just to make external net connections.

It started to work after: $ sudo semanage permissive -a postgresql_t

There may be a strict tighter way of allowing it (tds-fdw) to work, but right now I'll go with that.

If I google now, it is obvious; there is similar problems with php and freetds, but couldn't find it right away few hours ago, so wrote this note (issue) here also. It can be confusing problem when tds_fdw just says "Permission denied", and you wonder why when you have double checked server/port/user/passwrd/database/schema several times to be correct and working with tsql command.

SudoerWithAnOpinion commented 5 years ago

@GeoffMontee: How difficult would it be to ask the error handler to check for SELinux when connections fail, or at least add a note to its output?