@@ -188,7 +188,6 @@ func goFdwBeginForeignScan(node *C.ForeignScanState, eflags C.int) {
188188 FdwError (fmt .Errorf ("%v" , r ))
189189 }
190190 }()
191- log .Printf ("[TRACE] goFdwBeginForeignScan" )
192191 // read the explain flag
193192 explain := eflags & C .EXEC_FLAG_EXPLAIN_ONLY == C .EXEC_FLAG_EXPLAIN_ONLY
194193
@@ -269,9 +268,10 @@ func goFdwIterateForeignScan(node *C.ForeignScanState) *C.TupleTableSlot {
269268 C .ExecClearTuple (slot )
270269 pluginHub , _ := hub .GetHub ()
271270
271+ log .Printf ("[INFO] goFdwIterateForeignScan, table '%s' (%p)" , s .Opts ["table" ], s .Iter )
272272 // if the iterator has not started, start
273273 if s .Iter .Status () == hub .QueryStatusReady {
274- log .Printf ("[TRACE ] goFdwIterateForeignScan calling pluginHub.StartScan" )
274+ log .Printf ("[INFO ] goFdwIterateForeignScan calling pluginHub.StartScan, table '%s' (%p)" , s . Opts [ "table" ], s . Iter )
275275 if err := pluginHub .StartScan (s .Iter ); err != nil {
276276 FdwError (err )
277277 return slot
@@ -281,12 +281,13 @@ func goFdwIterateForeignScan(node *C.ForeignScanState) *C.TupleTableSlot {
281281 // row is a map of column name to value (as an interface)
282282 row , err := s .Iter .Next ()
283283 if err != nil {
284+ log .Printf ("[INFO] goFdwIterateForeignScan Next returned error: %s (%p)" , err .Error (), s .Iter )
284285 FdwError (err )
285286 return slot
286287 }
287288
288289 if len (row ) == 0 {
289- log .Printf ("[TRACE ] goFdwIterateForeignScan returned empty row - this scan complete (%p)" , s .Iter )
290+ log .Printf ("[INFO ] goFdwIterateForeignScan returned empty row - this scan complete (%p)" , s .Iter )
290291 // add scan metadata to hub
291292 pluginHub .AddScanMetadata (s .Iter )
292293 logging .LogTime ("[fdw] IterateForeignScan end" )
@@ -333,7 +334,10 @@ func goFdwReScanForeignScan(node *C.ForeignScanState) {
333334 FdwError (fmt .Errorf ("%v" , r ))
334335 }
335336 }()
336- log .Printf ("[TRACE] goFdwReScanForeignScan" )
337+ rel := BuildRelation (node .ss .ss_currentRelation )
338+ opts := GetFTableOptions (rel .ID )
339+
340+ log .Printf ("[INFO] goFdwReScanForeignScan, connection '%s', table '%s'" , opts ["connection" ], opts ["table" ])
337341 // restart the scan
338342 goFdwBeginForeignScan (node , 0 )
339343}
@@ -349,11 +353,12 @@ func goFdwEndForeignScan(node *C.ForeignScanState) {
349353 s := GetExecState (node .fdw_state )
350354 pluginHub , _ := hub .GetHub ()
351355 if s != nil && pluginHub != nil {
352- log .Printf ("[TRACE ] goFdwEndForeignScan, iterator: %p" , s .Iter )
356+ log .Printf ("[INFO ] goFdwEndForeignScan, iterator: %p" , s .Iter )
353357 pluginHub .EndScan (s .Iter , int64 (s .State .limit ))
354358 }
355359 ClearExecState (node .fdw_state )
356360 node .fdw_state = nil
361+
357362}
358363
359364//export goFdwAbortCallback
@@ -364,7 +369,7 @@ func goFdwAbortCallback() {
364369 // DO NOT call FdwError or we will recurse
365370 }
366371 }()
367- log .Printf ("[TRACE ] goFdwAbortCallback" )
372+ log .Printf ("[INFO ] goFdwAbortCallback" )
368373 if pluginHub , err := hub .GetHub (); err == nil {
369374 pluginHub .Abort ()
370375 }
0 commit comments