git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dec4ed3)
Use pg_get_constraintdef() rather than pg_constraint.consrc; this is
2003年10月17日 00:57:04 +0000 (00:57 +0000)
2003年10月17日 00:57:04 +0000 (00:57 +0000)
a portion of a patch recently submitted by Christopher Kings-Lynne.
Applied by agreement that this is a bug fix.


diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index fa1743f1001c2b5d4f520a7b27bf2fbe1b46c15c..9db5dad3da6bca92dcd9ac267c61f00931cd5ff2 100644 (file)
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.85 2003年09月07日 03:43:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.86 2003年10月17日 00:57:04 tgl Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
@@ -986,9 +986,11 @@ describeOneTableDetails(const char *schemaname,
if (tableinfo.checks)
{
printfPQExpBuffer(&buf,
- "SELECT consrc, conname\n"
+ "SELECT "
+ "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'",
+ "WHERE r.conrelid = '%s' AND r.contype = 'c'",
oid);
result2 = PSQLexec(buf.data, false);
if (!result2)
@@ -1119,7 +1121,7 @@ describeOneTableDetails(const char *schemaname,
footers[count_footers++] = xstrdup(buf.data);
for (i = 0; i < check_count; i++)
{
- printfPQExpBuffer(&buf, _(" \"%s\" CHECK %s"),
+ printfPQExpBuffer(&buf, _(" \"%s\" %s"),
PQgetvalue(result2, i, 1),
PQgetvalue(result2, i, 0));
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /