Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d662f293
Commit
d662f293
authored
May 03, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use quote_identifier on relation names in EXPLAIN output, per suggestion
from Liam Stewart. Minor code cleanups also.
parent
4a2fe8e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
src/backend/commands/explain.c
src/backend/commands/explain.c
+10
-14
No files found.
src/backend/commands/explain.c
View file @
d662f293
...
...
@@ -5,12 +5,13 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.7
5 2002/03/24 17:11:36
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.7
6 2002/05/03 15:56:45
tgl Exp $
*
*/
#include "postgres.h"
#include "access/genam.h"
#include "access/heapam.h"
#include "catalog/pg_type.h"
#include "commands/explain.h"
...
...
@@ -26,7 +27,6 @@
#include "utils/builtins.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
#include "utils/relcache.h"
typedef
struct
ExplainState
...
...
@@ -62,9 +62,6 @@ static void do_text_output(TextOutputState *tstate, char *aline);
static
void
do_text_output_multiline
(
TextOutputState
*
tstate
,
char
*
text
);
static
void
end_text_output
(
TextOutputState
*
tstate
);
/* Convert a null string pointer into "<>" */
#define stringStringInfo(s) (((s) == NULL) ? "<>" : (s))
/*
* ExplainQuery -
...
...
@@ -227,7 +224,6 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
int
indent
,
ExplainState
*
es
)
{
List
*
l
;
Relation
relation
;
char
*
pname
;
int
i
;
...
...
@@ -322,13 +318,13 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
i
=
0
;
foreach
(
l
,
((
IndexScan
*
)
plan
)
->
indxid
)
{
relation
=
RelationIdGetRelation
(
lfirsti
(
l
));
Assert
(
relation
);
Relation
relation
;
relation
=
index_open
(
lfirsti
(
l
));
appendStringInfo
(
str
,
"%s%s"
,
(
++
i
>
1
)
?
", "
:
""
,
stringStringInfo
(
RelationGetRelationName
(
relation
)));
/* drop relcache refcount from RelationIdGetRelation */
RelationDecrementReferenceCount
(
relation
);
quote_identifier
(
RelationGetRelationName
(
relation
)));
index_close
(
relation
);
}
/* FALL THRU */
case
T_SeqScan
:
...
...
@@ -346,10 +342,10 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
relname
=
get_rel_name
(
rte
->
relid
);
appendStringInfo
(
str
,
" on %s"
,
stringStringInfo
(
relname
));
quote_identifier
(
relname
));
if
(
strcmp
(
rte
->
eref
->
aliasname
,
relname
)
!=
0
)
appendStringInfo
(
str
,
" %s"
,
stringStringInfo
(
rte
->
eref
->
aliasname
));
quote_identifier
(
rte
->
eref
->
aliasname
));
}
break
;
case
T_SubqueryScan
:
...
...
@@ -359,7 +355,7 @@ explain_outNode(StringInfo str, Plan *plan, Plan *outer_plan,
es
->
rtable
);
appendStringInfo
(
str
,
" %s"
,
stringStringInfo
(
rte
->
eref
->
aliasname
));
quote_identifier
(
rte
->
eref
->
aliasname
));
}
break
;
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment