Skip to content

Commit 4b70629

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 parent a9b6b01 commit 4b70629

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/24 01:38:39 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/large_obj.c,v 1.12 2000/10/24 04:13:28 tgl Exp $
77
*/
88
#include "postgres.h"
99
#include "large_obj.h"
@@ -328,9 +328,8 @@ do_lo_list(void)
328328
printQueryOpt myopt = 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy