Everything is sorted by object name in \d <table> except check constraints for some reason. It seems it's ordering by the wrong column.

Seems like a bug to me.

Attached is the trivial patch.

Chris
Index: src/bin/psql/describe.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.127
diff -c -r1.127 describe.c
*** src/bin/psql/describe.c     15 Oct 2005 02:49:40 -0000      1.127
--- src/bin/psql/describe.c     20 Oct 2005 04:58:58 -0000
***************
*** 1040,1046 ****
                                                          
"pg_catalog.pg_get_constraintdef(r.oid, true), "
                                                          "conname\n"
                                                          "FROM 
pg_catalog.pg_constraint r\n"
!                                       "WHERE r.conrelid = '%s' AND r.contype 
= 'c' ORDER BY 1",
                                                          oid);
                        result2 = PSQLexec(buf.data, false);
                        if (!result2)
--- 1040,1046 ----
                                                          
"pg_catalog.pg_get_constraintdef(r.oid, true), "
                                                          "conname\n"
                                                          "FROM 
pg_catalog.pg_constraint r\n"
!                                       "WHERE r.conrelid = '%s' AND r.contype 
= 'c' ORDER BY 2",
                                                          oid);
                        result2 = PSQLexec(buf.data, false);
                        if (!result2)
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to