Skip to content

Commit

Permalink
Fix caching in standalone FDW extension. Closes #480
Browse files Browse the repository at this point in the history
  • Loading branch information
pskrbasu authored Aug 1, 2024
1 parent 8dc8696 commit 4409fa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
13 changes: 1 addition & 12 deletions fdw.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,9 @@ func goFdwGetRelSize(state *C.FdwPlanState, root *C.PlannerInfo, rows *C.double,

pluginHub := hub.GetHub()

// get connection name
connName := GetSchemaNameFromForeignTableId(types.Oid(state.foreigntableid))

log.Println("[TRACE] connection name:", connName)

serverOpts := GetForeignServerOptionsFromFTableId(types.Oid(state.foreigntableid))
err := pluginHub.ProcessImportForeignSchemaOptions(serverOpts, connName)
if err != nil {
FdwError(sperr.WrapWithMessage(err, "failed to process options"))
}

// reload connection config
// TODO remove need for fdw to load connection config
_, err = pluginHub.LoadConnectionConfig()
_, err := pluginHub.LoadConnectionConfig()
if err != nil {
log.Printf("[ERROR] LoadConnectionConfig failed %v ", err)
FdwError(err)
Expand Down
1 change: 1 addition & 0 deletions hub/hub_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func (l *HubLocal) ProcessImportForeignSchemaOptions(opts types.Options, connect
// do we already have this connection
connectionConfig, ok := l.connections[connection]
if ok {
log.Println("[INFO] connection already exists, updating ")
// we have already set the config - update it
connectionConfig.Config = config
return l.UpdateConnectionConfig(connection, config)
Expand Down

0 comments on commit 4409fa4

Please sign in to comment.