|
3 | 3 | *
|
4 | 4 | * Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
5 | 5 | *
|
6 |
| - * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.85 2003/09/07 03:43:53 momjian Exp $ |
| 6 | + * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.86 2003/10/17 00:57:04 tgl Exp $ |
7 | 7 | */
|
8 | 8 | #include"postgres_fe.h"
|
9 | 9 | #include"describe.h"
|
@@ -986,9 +986,11 @@ describeOneTableDetails(const char *schemaname,
|
986 | 986 | if (tableinfo.checks)
|
987 | 987 | {
|
988 | 988 | printfPQExpBuffer(&buf,
|
989 |
| -"SELECT consrc, conname\n" |
| 989 | +"SELECT " |
| 990 | +"pg_catalog.pg_get_constraintdef(r.oid, true), " |
| 991 | +"conname\n" |
990 | 992 | "FROM pg_catalog.pg_constraint r\n"
|
991 |
| -"WHERE r.conrelid = '%s' AND r.contype = 'c'", |
| 993 | +"WHERE r.conrelid = '%s' AND r.contype = 'c'", |
992 | 994 | oid);
|
993 | 995 | result2=PSQLexec(buf.data, false);
|
994 | 996 | if (!result2)
|
@@ -1119,7 +1121,7 @@ describeOneTableDetails(const char *schemaname,
|
1119 | 1121 | footers[count_footers++]=xstrdup(buf.data);
|
1120 | 1122 | for (i=0;i<check_count;i++)
|
1121 | 1123 | {
|
1122 |
| -printfPQExpBuffer(&buf,_(" \"%s\"CHECK%s"), |
| 1124 | +printfPQExpBuffer(&buf,_(" \"%s\" %s"), |
1123 | 1125 | PQgetvalue(result2,i,1),
|
1124 | 1126 | PQgetvalue(result2,i,0));
|
1125 | 1127 |
|
|