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

Build fails against PostgreSQL 9.6 #101

Open devrimgunduz opened 7 years ago

devrimgunduz commented 7 years ago

Hi,

I'm getting build errors with 1.0.7 against 9.6. I did not use 2.0.0, as it was marked as pre-release, because I'm building the RPMs. Any chance to release 1.0.8 for 9.6 support or release 2.0.0 with 0.6 support? Thanks!


+ make USE_PGXS=1 -j3
src/tds_fdw.c: In function 'tdsGetForeignPaths':
src/tds_fdw.c:1902:4: error: incompatible type for argument 3 of 'create_foreignscan_path'
    NIL, NULL, NULL, NIL));
    ^
In file included from src/tds_fdw.c:57:0:
/usr/pgsql-9.6/include/server/optimizer/pathnode.h:90:21: note: expected 'struct PathTarget *' but argument is of type 'double'
 extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
                     ^
src/tds_fdw.c:1902:4: error: incompatible type for argument 6 of 'create_foreignscan_path'
    NIL, NULL, NULL, NIL));
    ^
In file included from src/tds_fdw.c:57:0:
/usr/pgsql-9.6/include/server/optimizer/pathnode.h:90:21: note: expected 'Cost' but argument is of type 'struct List *'
 extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
                     ^
src/tds_fdw.c:1902:4: warning: passing argument 9 of 'create_foreignscan_path' from incompatible pointer type [enabled by default]
    NIL, NULL, NULL, NIL));
    ^
In file included from src/tds_fdw.c:57:0:
/usr/pgsql-9.6/include/server/optimizer/pathnode.h:90:21: note: expected 'struct Path *' but argument is of type 'struct List *'
 extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
                     ^
src/tds_fdw.c:1902:4: error: too few arguments to function 'create_foreignscan_path'
    NIL, NULL, NULL, NIL));
    ^
In file included from src/tds_fdw.c:57:0:
/usr/pgsql-9.6/include/server/optimizer/pathnode.h:90:21: note: declared here
 extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
                     ^
make[1]: *** [src/tds_fdw.o] Error 1
make[1]: *** Waiting for unfinished jobs....
error: Bad exit status from /var/tmp/rpm-tmp.KsIjBD (%build)
    Bad exit status from /var/tmp/rpm-tmp.KsIjBD (%build)
GeoffMontee commented 7 years ago

Hi @devrimgunduz,

Thanks for building tds_fdw RPMs!

I'm not sure what to do for 9.6 support yet. I was hoping to have 2.0 stable by now, but the write functionality is taking longer than I expected, and it looks like the WHERE/column pushdown functionality might have some important bugs that still need to be fixed. I'll probably try to do one of the following things for 9.6 support when I find the time:

If I go with the first option, I will still probably try to release a 2.0 beta release before declaring 2.0 as stable, so in that case, 9.6 users might still have to wait a little while for a stable release. I'll think about this some more.

devrimgunduz commented 7 years ago

Hi, 9.6.1 will be released this week, and we are still missing tds_fdw, breaking upgrades. A 1.0.8 with 9.6 support would be really great, if you cannot make 2.0 stable until then. Release is on Thursday, so we need the release asap.

Thanks!

GeoffMontee commented 7 years ago

I just created a 1.0.8 release that builds with PostgreSQL 9.6 and has tds_version 7.4 support. You can find it here:

https://github.com/tds-fdw/tds_fdw/releases/tag/v1.0.8

Please let me know if you have any trouble with that release.

Smtgr14 commented 7 years ago

When running $ make USE_PGXS=1 I get this output and the build fails.

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-
aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -
fno-omit-frame-pointer -fpic -I./include/ -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOU
RCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/tcl8.6  -c -o src/tds_fdw.o src/tds_fdw.c                     
src/tds_fdw.c: In function ‘tdsGetForeignRelSize’:                                                                                                   
src/tds_fdw.c:1842:1: warning: label ‘cleanup_before_login’ defined but not used [-Wunused-label]                                                    
 cleanup_before_login:                                                                                                                               
 ^                                                                                                                                                   
src/tds_fdw.c: In function ‘tdsGetForeignPaths’:                                                          
src/tds_fdw.c:1961:1: error: unknown type name ‘FdwPlan’                                                                                             
 FdwPlan* tdsPlanForeignScan(Oid foreigntableid, PlannerInfo *root, RelOptInfo *baserel)                                                             
 ^                                                                                                                                                   
src/tds_fdw.c:1962:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token                                                       
 {                                                                                                                                                   
 ^                                                                                                                                                   
src/tds_fdw.c:1961:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]      
 FdwPlan* tdsPlanForeignScan(Oid foreigntableid, PlannerInfo *root, RelOptInfo *baserel)                                                             
 ^                                                                                                                                                   
src/tds_fdw.c:1762:0: error: unterminated #if                                                                                                        
 #if (PG_VERSION_NUM >= 90200)                                                                                                                       
 ^                                                                                                                                                   
src/tds_fdw.c:2121:1: error: expected declaration or statement at end of input                                                                       
 }                                                                                                                                                   
 ^                                                                                                                                                   
<builtin>: recipe for target 'src/tds_fdw.o' failed                                                                                                  
make: *** [src/tds_fdw.o] Error 1 
GeoffMontee commented 7 years ago

Hi @Smtgr14,

Thanks for pointing out those problems. I just committed a fix for those, and I re-released a working 1.0.8 release.

I did test the first 1.0.8 release on 9.6, but now I'm not sure how I managed to do build it. Maybe I had accidentally switched back to the 2.0 branch. If I keep maintaining this 1.0 branch while I develop 2.0, I will probably try to test the branch in Jenkins, so that these types of problems can be avoided.

Thanks again for testing 1.0.8!

Smtgr14 commented 7 years ago

No problem. Everything works exactly as before and upgrading FTable definitions from 9.5 works seamlessly as well. Though, I noticed times are now coming in as, what appears to be, UTC. I'm still checking those but I'll open a new issue for that is it continues to manifest.

Smtgr14 commented 7 years ago

Is the WHERE pushdown working? I'm running a previously fast running query and it's taking a long time. Queries on much smaller tables without any WHERE clause still execute almost instantly.

GeoffMontee commented 7 years ago

WHERE pushdown is a new feature in 2.0, so that isn't in 1.0.8. I created the new 1.0 branch from commit 7b7464cef18ac59b6b986bed6fda4c00310e8813, which is the commit just before I added the deparse.c port for WHERE and column pushdowns.

If you want WHERE pushdowns, then using the master branch is probably your best option at the moment. I need to get another 2.0 release out at some point.

jgoux commented 7 years ago

Hello, I've installed the 1.0.8 version, but now I want to upgrade the extension to be able to use the IMPORT SCHEMA feature. I cloned the repository and make the install, but even after doing a DROP EXTENSION + CREATE EXTENSION, it keeps telling me that the driver doesn't support IMPORT SCHEMA. I'm on PG 9.5.

What did I make wrong ?

Smtgr14 commented 7 years ago

@jgoux: Please open a separate issue for this. @GeoffMontee any chance we can get an ETA for where pushdown? I love the parallelism in PG 9.6 but without WHERE pushdown, I can't upgrade. I've got a terrible rebase that works (mostly) and I'd rather not rely on it. Until then, I'll keep trying to perfect it.

pembo13 commented 7 years ago

Confirming that https://github.com/tds-fdw/tds_fdw/blob/master/InstallCentOS.md works with export TDS_FDW_VERSION="1.0.8"

lalligood commented 7 years ago

Yes. I just installed version 1.0.8 of this FDW for the first time earlier today on a CentOS server. Works as advertised!

--Lance

On Fri, Jul 28, 2017 at 11:38 AM, Arthur Pemberton <notifications@github.com

wrote:

Confirming that https://github.com/tds-fdw/tds_fdw/blob/master/ InstallCentOS.md works with export TDS_FDW_VERSION="1.0.8"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tds-fdw/tds_fdw/issues/101#issuecomment-318686967, or mute the thread https://github.com/notifications/unsubscribe-auth/ADbVH1pWeUXSit6xtrpEjM_e6NuU73Z2ks5sSgBdgaJpZM4KIiBC .

GeoffMontee commented 7 years ago

Hi @Smtgr14,

@GeoffMontee any chance we can get an ETA for where pushdown? I love the parallelism in PG 9.6 but without WHERE pushdown, I can't upgrade. I've got a terrible rebase that works (mostly) and I'd rather not rely on it. Until then, I'll keep trying to perfect it.

The master branch contains an experimental version of WHERE pushdowns. Is that not working with 9.6 at the moment? It seems to pass the tests:

https://jenkins.juliogonzalez.es/job/tds_fdw-build/

I haven't fixed many bugs lately as I've been busy with other projects, so I apologize if WHERE pushdown is not working for you. If anyone else wants to work on it and submit a pull request, I would be very grateful for contributions.

thatguypark commented 6 years ago

Had the same issue on Postgresql 9.6. The 1.0.8 version compiled successfully on my Debian 9.4 and seemed to do the trick.

akinba commented 5 years ago

i had same problem with v1.0.7 on PostgreSQL 10 (Centos 7). v1.0.8 works fine. Commends for Quick install: export TDS_FDW_VERSION="1.0.8" wget https://github.com/tds-fdw/tds_fdw/archive/v${TDS_FDW_VERSION}.tar.gz -O tds_fdw-${TDS_FDW_VERSION}.tar.gz tar -xvzf tds_fdw-${TDS_FDW_VERSION}.tar.gz cd tds_fdw-${TDS_FDW_VERSION} PATH=/usr/pgsql-10/bin:$PATH make USE_PGXS=1 sudo PATH=/usr/pgsql-10/bin:$PATH make USE_PGXS=1 install