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

Commitfa2356a

Browse files
committed
Use pg_get_constraintdef() rather than pg_constraint.consrc; this is
a portion of a patch recently submitted by Christopher Kings-Lynne.Applied by agreement that this is a bug fix.
1 parentdec4ed3 commitfa2356a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/bin/psql/describe.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
55
*
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 $
77
*/
88
#include"postgres_fe.h"
99
#include"describe.h"
@@ -986,9 +986,11 @@ describeOneTableDetails(const char *schemaname,
986986
if (tableinfo.checks)
987987
{
988988
printfPQExpBuffer(&buf,
989-
"SELECT consrc, conname\n"
989+
"SELECT "
990+
"pg_catalog.pg_get_constraintdef(r.oid, true), "
991+
"conname\n"
990992
"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'",
992994
oid);
993995
result2=PSQLexec(buf.data, false);
994996
if (!result2)
@@ -1119,7 +1121,7 @@ describeOneTableDetails(const char *schemaname,
11191121
footers[count_footers++]=xstrdup(buf.data);
11201122
for (i=0;i<check_count;i++)
11211123
{
1122-
printfPQExpBuffer(&buf,_(" \"%s\"CHECK%s"),
1124+
printfPQExpBuffer(&buf,_(" \"%s\" %s"),
11231125
PQgetvalue(result2,i,1),
11241126
PQgetvalue(result2,i,0));
11251127

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp