aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-11-12 15:57:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-11-12 15:57:08 +0000
commit112bd6f06b0b4c556dc23682c98ca107bfca387b (patch)
treefb670fc9f6108074fe0673a90f3f6c00308fc1b1 /src
parent905109f24a49caed336ffe15f8191be440c42305 (diff)
downloadpostgresql-112bd6f06b0b4c556dc23682c98ca107bfca387b.tar.gz
postgresql-112bd6f06b0b4c556dc23682c98ca107bfca387b.zip
psql's \do was going out of its way to lie about the result type of
operators. Should report the declared oprresult type, not the return type of the underlying proc, which might be only binary-compatible (cf. textcat entries).
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/describe.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 6fefdf49da1..e285535c817 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.41 2001/10/25 05:49:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.42 2001/11/12 15:57:08 tgl Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
@@ -213,15 +213,14 @@ describeOperators(const char *name)
"SELECT o.oprname AS \"%s\",\n"
" CASE WHEN o.oprkind='l' THEN NULL ELSE format_type(o.oprleft, NULL) END AS \"%s\",\n"
" CASE WHEN o.oprkind='r' THEN NULL ELSE format_type(o.oprright, NULL) END AS \"%s\",\n"
- " format_type(p.prorettype, NULL) AS \"%s\",\n"
- " obj_description(p.oid, 'pg_proc') as \"%s\"\n"
- "FROM pg_proc p, pg_operator o\n"
- "WHERE RegprocToOid(o.oprcode) = p.oid\n",
+ " format_type(o.oprresult, NULL) AS \"%s\",\n"
+ " obj_description(o.oprcode, 'pg_proc') AS \"%s\"\n"
+ "FROM pg_operator o\n",
_("Name"), _("Left arg type"), _("Right arg type"),
_("Result type"), _("Description"));
if (name)
{
- strcat(buf, " AND o.oprname = '");
+ strcat(buf, "WHERE o.oprname = '");
strncat(buf, name, REGEXP_CUTOFF);
strcat(buf, "'\n");
}