Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5bd1d3

Browse files
committed
Make \d order a table's check constraints by constraint name instead
of the text of the constraint condition. Per Chris K-L, though I didn'tuse his patch exactly.
1 parentd9cb487 commita5bd1d3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/bin/psql/describe.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.127 2005/10/15 02:49:40 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.128 2005/10/20 05:15:09 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"describe.h"
@@ -1036,9 +1036,8 @@ describeOneTableDetails(const char *schemaname,
10361036
if (tableinfo.checks)
10371037
{
10381038
printfPQExpBuffer(&buf,
1039-
"SELECT "
1040-
"pg_catalog.pg_get_constraintdef(r.oid, true), "
1041-
"conname\n"
1039+
"SELECT r.conname, "
1040+
"pg_catalog.pg_get_constraintdef(r.oid, true)\n"
10421041
"FROM pg_catalog.pg_constraint r\n"
10431042
"WHERE r.conrelid = '%s' AND r.contype = 'c' ORDER BY 1",
10441043
oid);
@@ -1192,8 +1191,8 @@ describeOneTableDetails(const char *schemaname,
11921191
for (i=0;i<check_count;i++)
11931192
{
11941193
printfPQExpBuffer(&buf,_(" \"%s\" %s"),
1195-
PQgetvalue(result2,i,1),
1196-
PQgetvalue(result2,i,0));
1194+
PQgetvalue(result2,i,0),
1195+
PQgetvalue(result2,i,1));
11971196

11981197
footers[count_footers++]=pg_strdup(buf.data);
11991198
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp