Fix misplaced ReleaseSysCache call in get_default_partition_oid.
authorRobert Haas <rhaas@postgresql.org>
Sat, 28 Oct 2017 09:10:21 +0000 (11:10 +0200)
committerRobert Haas <rhaas@postgresql.org>
Sat, 28 Oct 2017 09:10:21 +0000 (11:10 +0200)
Julien Rouhaud

Discussion: http://postgr.es/m/CAOBaU_Y4omLA+VbsVdA-JwBLoJWiPxfdKCkMjrZM7NMZxa1fKw@mail.gmail.com

src/backend/catalog/partition.c

index 07fdf66c3858ff91ca0d7817d00462023d2c1fb7..66ec214e029ec04291aac520a129a54fda06644c 100644 (file)
@@ -2831,9 +2831,9 @@ get_default_partition_oid(Oid parentId)
 
                part_table_form = (Form_pg_partitioned_table) GETSTRUCT(tuple);
                defaultPartId = part_table_form->partdefid;
+               ReleaseSysCache(tuple);
        }
 
-       ReleaseSysCache(tuple);
        return defaultPartId;
 }