Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backup/predata_externals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ var _ = Describe("backup/predata_externals tests", func() {
extTableDef.URIs = []string{"file://host:port/path/file"}
testTable.ExtTableDef = extTableDef
backup.PrintExternalTableCreateStatement(backupfile, tocfile, testTable)
testutils.ExpectEntry(tocfile.PredataEntries, 0, "public", "", "tablename", toc.OBJ_TABLE)
expectedObjectType := toc.OBJ_TABLE
if (connectionPool.Version.IsGPDB() && connectionPool.Version.AtLeast("7")) || connectionPool.Version.IsCBDB() {
expectedObjectType = toc.OBJ_FOREIGN_TABLE
}
testutils.ExpectEntry(tocfile.PredataEntries, 0, "public", "", "tablename", expectedObjectType)
testutils.AssertBufferContents(tocfile.PredataEntries, buffer, `CREATE READABLE EXTERNAL TABLE public.tablename (
) LOCATION (
'file://host:port/path/file'
Expand Down
3 changes: 3 additions & 0 deletions backup/queries_table_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func (t Table) GetMetadataEntry() (string, toc.MetadataEntry) {
if (t.ForeignDef != ForeignTableDefinition{}) {
objectType = toc.OBJ_FOREIGN_TABLE
}
if t.IsExternal && ((connectionPool.Version.IsGPDB() && connectionPool.Version.AtLeast("7")) || connectionPool.Version.IsCBDB()) {
objectType = toc.OBJ_FOREIGN_TABLE
}
referenceObject := ""
if t.AttachPartitionInfo != (AttachPartitionInfo{}) {
referenceObject = t.AttachPartitionInfo.Parent
Expand Down