tds-fdw / tds_fdw

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

Installing tds_fdw for PostgreSQL 12 #234

Closed ghost closed 4 years ago

ghost commented 4 years ago

I've a Centos 7, PostgreSQL 12 and tds_fdw 1.0.8. I got an error when I'm trying to: make USE_PGXS=1 PG_CONFIG=/usr/pgsql-12/bin/pg_config

src/tds_fdw.c: In function ‘tdsGetColumnMetadata’: src/tds_fdw.c:1250:70: error: invalid type argument of ‘->’ (have ‘FormData_pg_attribute’) char* local_name = festate->attinmeta->tupdesc->attrs[local_ncol]->attname.data; ^ src/tds_fdw.c:1255:71: error: invalid type argument of ‘->’ (have ‘FormData_pg_attribute’) column->attr_oid = festate->attinmeta->tupdesc->attrs[local_ncol]->atttypid; ^ In file included from /usr/pgsql-12/include/server/postgres.h:47:0, from src/tds_fdw.c:28: src/tds_fdw.c:1288:47: error: invalid type argument of ‘->’ (have ‘FormData_pg_attribute’) festate->attinmeta->tupdesc->attrs[ncol]->attname.data) ^ /usr/pgsql-12/include/server/utils/elog.h:125:14: note: in definition of macro ‘ereport_domain’ errfinish rest; \ ^ src/tds_fdw.c:1284:5: note: in expansion of macro ‘ereport’ ereport(WARNING, ^ src/tds_fdw.c: In function ‘tdsIterateForeignScan’: src/tds_fdw.c:1638:5: warning: implicit declaration of function ‘ExecStoreTuple’ [-Wimplicit-function-declaration] ExecStoreTuple(tuple, slot, InvalidBuffer, false); ^ make: *** [src/tds_fdw.o] Error 1

SudoerWithAnOpinion commented 4 years ago

What version of FreeTDS are you using?

juliogonzalez commented 4 years ago

1.0.8 does not work with PostgreSQL 11, and despite we didn't try with PostgreSQL 12, I suspect it's the same case because this error seems similar.

Try with v2.0.0-alpha.3. It should work fine, and it's covered by our CI.

juliogonzalez commented 4 years ago

Closing, I updated https://github.com/tds-fdw/tds_fdw/releases/tag/v1.0.8 to show that it's not compatible with PostgreSQL >= 11