]> granicus.if.org Git - postgresql/commitdiff
Fix for new pg_upgrade cache code.
authorBruce Momjian <bruce@momjian.us>
Wed, 20 Oct 2010 01:24:31 +0000 (01:24 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 20 Oct 2010 01:24:31 +0000 (01:24 +0000)
contrib/pg_upgrade/info.c

index 946e6ccb6bacc83ef979ff281e420bba446e1884..cd408e17636c4274f0eb3d8949d0b37c9f1c2cf2 100644 (file)
@@ -429,7 +429,8 @@ relarr_lookup_rel(RelInfoArr *rel_arr,
                return NULL;
 
        /* Test most recent lookup first, for speed */
-       if (strcmp(rel_arr->rels[relnum].nspname, nspname) == 0 &&
+       if (relnum < rel_arr->nrels &&
+               strcmp(rel_arr->rels[relnum].nspname, nspname) == 0 &&
                strcmp(rel_arr->rels[relnum].relname, relname) == 0)
                return &rel_arr->rels[relnum];