Skip to content

Commit 4409fa4

Browse files
authored
Fix caching in standalone FDW extension. Closes #480
1 parent 8dc8696 commit 4409fa4

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

fdw.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,9 @@ func goFdwGetRelSize(state *C.FdwPlanState, root *C.PlannerInfo, rows *C.double,
133133

134134
pluginHub := hub.GetHub()
135135

136-
// get connection name
137-
connName := GetSchemaNameFromForeignTableId(types.Oid(state.foreigntableid))
138-
139-
log.Println("[TRACE] connection name:", connName)
140-
141-
serverOpts := GetForeignServerOptionsFromFTableId(types.Oid(state.foreigntableid))
142-
err := pluginHub.ProcessImportForeignSchemaOptions(serverOpts, connName)
143-
if err != nil {
144-
FdwError(sperr.WrapWithMessage(err, "failed to process options"))
145-
}
146-
147136
// reload connection config
148137
// TODO remove need for fdw to load connection config
149-
_, err = pluginHub.LoadConnectionConfig()
138+
_, err := pluginHub.LoadConnectionConfig()
150139
if err != nil {
151140
log.Printf("[ERROR] LoadConnectionConfig failed %v ", err)
152141
FdwError(err)

hub/hub_local.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func (l *HubLocal) ProcessImportForeignSchemaOptions(opts types.Options, connect
155155
// do we already have this connection
156156
connectionConfig, ok := l.connections[connection]
157157
if ok {
158+
log.Println("[INFO] connection already exists, updating ")
158159
// we have already set the config - update it
159160
connectionConfig.Config = config
160161
return l.UpdateConnectionConfig(connection, config)

0 commit comments

Comments
 (0)