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

Commit112bd6f

Browse files
committed
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 typeof the underlying proc, which might be only binary-compatible (cf.textcat entries).
1 parent905109f commit112bd6f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/bin/psql/describe.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.41 2001/10/25 05:49:53 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.42 2001/11/12 15:57:08 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"describe.h"
@@ -213,15 +213,14 @@ describeOperators(const char *name)
213213
"SELECT o.oprname AS \"%s\",\n"
214214
" CASE WHEN o.oprkind='l' THEN NULL ELSE format_type(o.oprleft, NULL) END AS \"%s\",\n"
215215
" CASE WHEN o.oprkind='r' THEN NULL ELSE format_type(o.oprright, NULL) END AS \"%s\",\n"
216-
" format_type(p.prorettype, NULL) AS \"%s\",\n"
217-
" obj_description(p.oid, 'pg_proc') as \"%s\"\n"
218-
"FROM pg_proc p, pg_operator o\n"
219-
"WHERE RegprocToOid(o.oprcode) = p.oid\n",
216+
" format_type(o.oprresult, NULL) AS \"%s\",\n"
217+
" obj_description(o.oprcode, 'pg_proc') AS \"%s\"\n"
218+
"FROM pg_operator o\n",
220219
_("Name"),_("Left arg type"),_("Right arg type"),
221220
_("Result type"),_("Description"));
222221
if (name)
223222
{
224-
strcat(buf," AND o.oprname = '");
223+
strcat(buf,"WHERE o.oprname = '");
225224
strncat(buf,name,REGEXP_CUTOFF);
226225
strcat(buf,"'\n");
227226
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp