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

Commit4b70629

Browse files
committed
Rejigger do_lo_list's query so that obj_description() is evaluated only
once per distinct LO, not once per pg_largeobject tuple.
1 parenta9b6b01 commit4b70629

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/bin/psql/large_obj.c

Lines changed: 3 additions & 4 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/large_obj.c,v 1.11 2000/10/2401:38:39 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.12 2000/10/2404:13:28 tgl Exp $
77
*/
88
#include"postgres.h"
99
#include"large_obj.h"
@@ -328,9 +328,8 @@ do_lo_list(void)
328328
printQueryOptmyopt=pset.popt;
329329

330330
strcpy(buf,
331-
"SELECT DISTINCT loid as \"ID\",\n"
332-
" obj_description(loid) as \"Description\"\n"
333-
"FROM pg_largeobject\n"
331+
"SELECT loid as \"ID\", obj_description(loid) as \"Description\"\n"
332+
"FROM (SELECT DISTINCT loid FROM pg_largeobject) x\n"
334333
"ORDER BY \"ID\"");
335334

336335
res=PSQLexec(buf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp