提交 082e1c7b 编写于 作者: P Peter Eisentraut

Show islossy for index.

上级 b054fb3b
......@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.34 2001/06/30 17:26:11 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.35 2001/07/08 14:42:17 petere Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
......@@ -642,7 +642,7 @@ describeTableDetails(const char *name, bool desc)
{
PGresult *result;
sprintf(buf, "SELECT i.indisunique, i.indisprimary, a.amname\n"
sprintf(buf, "SELECT i.indisunique, i.indisprimary, i.indislossy, a.amname\n"
"FROM pg_index i, pg_class c, pg_am a\n"
"WHERE i.indexrelid = c.oid AND c.relname = '%s' AND c.relam = a.oid",
name);
......@@ -652,14 +652,18 @@ describeTableDetails(const char *name, bool desc)
error = true;
else
{
/* XXX This construction is poorly internationalized. */
footers = xmalloc(2 * sizeof(*footers));
footers[0] = xmalloc(NAMEDATALEN + 32);
sprintf(footers[0], "%s%s",
strcmp(PQgetvalue(result, 0, 0), "t") == 0 ? "unique " : "",
PQgetvalue(result, 0, 2)
footers[0] = xmalloc(NAMEDATALEN + 128);
snprintf(footers[0], NAMEDATALEN + 128, "%s%s%s",
strcmp(PQgetvalue(result, 0, 0), "t") == 0 ? _("unique ") : "",
PQgetvalue(result, 0, 3),
strcmp(PQgetvalue(result, 0, 2), "t") == 0 ? _(" (lossy)") : ""
);
if (strcmp(PQgetvalue(result, 0, 1), "t") == 0)
strcat(footers[0], " (primary key)");
snprintf(footers[0] + strlen(footers[0]),
NAMEDATALEN + 128 - strlen(footers[0]),
_(" (primary key)"));
footers[1] = NULL;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册