Skip to content

Commit c91f7a1

Browse files
authored
postgresql: Remove pg_catalog schema from tests (#638)
1 parent c644ee1 commit c91f7a1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

internal/engine/postgresql/catalog.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ func NewCatalog() *catalog.Catalog {
99
c.SearchPath = []string{"pg_catalog"}
1010
return c
1111
}
12+
13+
// The generated pg_catalog is very slow to compare because it has so
14+
// many entries. For testing, don't include it.
15+
func newTestCatalog() *catalog.Catalog {
16+
c := catalog.New("public")
17+
c.Schemas = append(c.Schemas, pgTemp())
18+
return c
19+
}

internal/engine/postgresql/catalog_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,13 @@ func TestUpdate(t *testing.T) {
564564
t.Fatal(err)
565565
}
566566

567-
c := NewCatalog()
567+
c := newTestCatalog()
568568
if err := c.Build(stmts); err != nil {
569569
t.Log(test.stmt)
570570
t.Fatal(err)
571571
}
572572

573-
e := NewCatalog()
573+
e := newTestCatalog()
574574
if test.s != nil {
575575
var replaced bool
576576
for i := range e.Schemas {

0 commit comments

Comments
 (0)