Permalink
Browse files

Merge pull request #16 from pgexperts/master

Make compatible with PostgreSQL 9.5 API.
  • Loading branch information...
2 parents 54b3c4d + f510c58 commit b277b085981af0dd014850d5e72d5f43cc2f00cf @guedes committed Apr 18, 2016
Showing with 21 additions and 12 deletions.
  1. +16 −4 src/ldap_fdw.c
  2. +5 −8 src/ldap_fdw.h
View
20 src/ldap_fdw.c
@@ -106,7 +106,11 @@ ldapGetForeignPaths(PlannerInfo *root,
add_path(baserel, (Path *)
create_foreignscan_path(root, baserel,
baserel->rows, startup_cost, total_cost,
- NIL, NULL, NIL));
+ NIL, NULL, NULL
+#if PG_VERSION_NUM >= 90500
+ , NIL
+#endif
+ ));
}
static ForeignScan *
@@ -115,13 +119,21 @@ ldapGetForeignPlan(PlannerInfo *root,
Oid foreigntableid,
ForeignPath *best_path,
List *tlist,
- List *scan_clauses)
+ List *scan_clauses
+#if PG_VERSION_NUM >= 90500
+ , Plan *outer_plan
+#endif
+ )
{
Index scan_relid = baserel->relid;
scan_clauses = extract_actual_clauses(scan_clauses, false);
- return make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL);
+ return make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL
+#if PG_VERSION_NUM >= 90500
+ , NIL, NIL, outer_plan
+#endif
+ );
}
static void
@@ -132,7 +144,7 @@ ldapExplainForeignScan(ForeignScanState *node, ExplainState *es)
if (es->costs)
{
- ExplainPropertyLong("Foreign Ldap cost", 10.5, es);
+ ExplainPropertyFloat("Foreign Ldap cost", 10.5, 1, es);
}
}
View
13 src/ldap_fdw.h
@@ -64,13 +64,6 @@
#define LDAP_FDW_OPTION_QUERY_DEFAULT (char *) "(objectClass=*)"
#define LDAP_FDW_OPTION_LDAP_VERSION_DEFAULT LDAP_VERSION3
-extern LDAP *ldap_init(char *, int);
-extern int ldap_simple_bind_s(LDAP *, const char *, const char *);
-extern char **ldap_get_values(LDAP *, LDAPMessage *, char *);
-extern int ldap_count_values(char **);
-extern void ldap_value_free(char **);
-extern int ldap_unbind(LDAP *);
-
/*
* Valid options that could be used by
* this wrapper
@@ -144,7 +137,11 @@ ldapGetForeignPlan(PlannerInfo *root,
Oid foreigntableid,
ForeignPath *best_path,
List *tlist,
- List *scan_clauses);
+ List *scan_clauses
+#if PG_VERSION_NUM >= 90500
+ , Plan *outer_plan
+#endif
+ );
static void
ldapExplainForeignScan(ForeignScanState *node,

0 comments on commit b277b08

Please sign in to comment.