Hi Jim,
Thank you for your review.
>I've been playing with a few edge cases and everything seems to work
>just fine. Bellow I am listing the cases I tested, so that you can take
>a look if some of them should be included in the regression tests - not
>sure if it is necessary, since this feature is only reading the
>constraint definitions from the catalog.
complex edge cases you tried were very helpful.
The method for converting constraints into definition strings in \dcs uses
the same function as \d (i.e., pg_catalog.pg_get_constraintdef), so I don’t
think there are any major issues there.
>One nitpick: the order of the constraints is different from the one in \d+:
>For consistency, it would be nice to have both options listing in the
>same order, but in case it would mean adding too much complexity to the
>code, I'd say it is just fine as-is.
Regarding the constraint display order, I hadn’t noticed that it differed
between \d and \dcs. Thanks for pointing that out.
In \dcs, constraints are sorted in ascending order by both schema name
and constraint name.
On the other hand, \d appears to use the column number as one of the
sorting keys. I believe this difference explains the discrepancy in the
display order.
As you suggested, I’d like to keep the current behavior to avoid adding
unnecessary complexity.
The next patch will include the following:
- Rebased version
- Expanded regression tests (kept to a minimum)
Regards,
Tatsuro Yamada