Skip to content

Commit

Permalink
Fix pg13 (#188)
Browse files Browse the repository at this point in the history
* Fix for #187 Support for PostgreSQL 13 beta1 and also use same for PG12
  • Loading branch information
robe2 committed May 25, 2020
1 parent 7785af5 commit 6b0f469
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ogr_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,12 @@ ogrReadColumnData(OgrFdwState* state)
tbl = palloc0(sizeof(OgrFdwTable));

/* One column for each PgSQL foreign table column */
#if PG_VERSION_NUM < 120000
rel = heap_open(state->foreigntableid, NoLock);
#else
rel = table_open(state->foreigntableid, NoLock);
#endif /* PG_VERSION_NUM */

tupdesc = rel->rd_att;
state->tupdesc = tupdesc;
tbl->ncols = tupdesc->natts;
Expand Down Expand Up @@ -1493,7 +1498,12 @@ ogrReadColumnData(OgrFdwState* state)
}
}
pfree(ogr_fields);
#if PG_VERSION_NUM < 120000
heap_close(rel, NoLock);
#else
table_close(rel, NoLock);
#endif /* PG_VERSION_NUM */


return;
}
Expand Down

0 comments on commit 6b0f469

Please sign in to comment.