File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 99 *
1010 *
1111 * IDENTIFICATION
12- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump_sort.c,v 1.27 2010/01/02 16:57:59 momjian Exp $
12+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump_sort.c,v 1.28 2010/02/15 19:59:47 petere Exp $
1313 *
1414 *-------------------------------------------------------------------------
1515 */
@@ -163,7 +163,18 @@ DOTypeNameCompare(const void *p1, const void *p2)
163163 if (cmpval != 0 )
164164 return cmpval ;
165165
166- /* Probably shouldn't get here, but if we do, sort by OID */
166+ /* To have a stable sort order, break ties for some object types */
167+ if (obj1 -> objType == DO_FUNC || obj1 -> objType == DO_AGG )
168+ {
169+ FuncInfo * fobj1 = * (FuncInfo * * ) p1 ;
170+ FuncInfo * fobj2 = * (FuncInfo * * ) p2 ;
171+
172+ cmpval = fobj1 -> nargs - fobj2 -> nargs ;
173+ if (cmpval != 0 )
174+ return cmpval ;
175+ }
176+
177+ /* Usually shouldn't get here, but if we do, sort by OID */
167178 return oidcmp (obj1 -> catId .oid , obj2 -> catId .oid );
168179}
169180
You can’t perform that action at this time.
0 commit comments