Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
96e218a0
Commit
96e218a0
authored
16 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Do not show information_schema in \d* commands, unless 'S' or pattern is
specified. Martin Pihlak
parent
c26ffb1e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/psql/describe.c
+35
-20
35 additions, 20 deletions
src/bin/psql/describe.c
with
35 additions
and
20 deletions
src/bin/psql/describe.c
+
35
−
20
View file @
96e218a0
...
...
@@ -8,7 +8,7 @@
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.20
4
2009/04/02 1
5:15:32
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.20
5
2009/04/02 1
7:38:26
momjian Exp $
*/
#include
"postgres_fe.h"
...
...
@@ -95,7 +95,8 @@ describeAggregates(const char *pattern, bool verbose, bool showSystem)
gettext_noop
(
"Description"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"p.proname"
,
NULL
,
...
...
@@ -282,7 +283,8 @@ describeFunctions(const char *pattern, bool verbose, bool showSystem)
" AND NOT p.proisagg
\n
"
);
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"p.proname"
,
NULL
,
...
...
@@ -373,7 +375,8 @@ describeTypes(const char *pattern, bool verbose, bool showSystem)
appendPQExpBuffer
(
&
buf
,
" AND t.typname !~ '^_'
\n
"
);
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
/* Match name pattern against either internal or external name */
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -428,7 +431,8 @@ describeOperators(const char *pattern, bool showSystem)
gettext_noop
(
"Description"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
"WHERE n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
true
,
"n.nspname"
,
"o.oprname"
,
NULL
,
...
...
@@ -632,7 +636,8 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"aggregate"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"p.proname"
,
NULL
,
...
...
@@ -655,7 +660,8 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"function"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"p.proname"
,
NULL
,
...
...
@@ -673,7 +679,8 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"operator"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
"WHERE n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"o.oprname"
,
NULL
,
...
...
@@ -691,7 +698,8 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"data type"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
"WHERE n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"pg_catalog.format_type(t.oid, NULL)"
,
...
...
@@ -714,8 +722,10 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"view"
),
gettext_noop
(
"index"
),
gettext_noop
(
"sequence"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"c.relname"
,
NULL
,
...
...
@@ -735,7 +745,8 @@ objectDescription(const char *pattern, bool showSystem)
gettext_noop
(
"rule"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
/* XXX not sure what to do about visibility rule here? */
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -753,8 +764,10 @@ objectDescription(const char *pattern, bool showSystem)
" JOIN pg_catalog.pg_class c ON c.oid = t.tgrelid
\n
"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
\n
"
,
gettext_noop
(
"trigger"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
"WHERE n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
/* XXX not sure what to do about visibility rule here? */
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
...
...
@@ -809,7 +822,8 @@ describeTableDetails(const char *pattern, bool verbose, bool showSystem)
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
\n
"
);
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" WHERE n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
"WHERE n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
!
showSystem
&&
!
pattern
,
false
,
"n.nspname"
,
"c.relname"
,
NULL
,
...
...
@@ -2014,9 +2028,8 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
appendPQExpBuffer
(
&
buf
,
")
\n
"
);
if
(
!
showSystem
&&
!
pattern
)
/* Exclude system and pg_toast objects, but show temp tables */
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
" AND n.nspname !~ '^pg_toast'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
...
...
@@ -2088,7 +2101,8 @@ listDomains(const char *pattern, bool showSystem)
gettext_noop
(
"Check"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"t.typname"
,
NULL
,
...
...
@@ -2143,7 +2157,8 @@ listConversions(const char *pattern, bool showSystem)
gettext_noop
(
"Default?"
));
if
(
!
showSystem
&&
!
pattern
)
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
);
appendPQExpBuffer
(
&
buf
,
" AND n.nspname <> 'pg_catalog'
\n
"
" AND n.nspname <> 'information_schema'
\n
"
);
processSQLNamePattern
(
pset
.
db
,
&
buf
,
pattern
,
true
,
false
,
"n.nspname"
,
"c.conname"
,
NULL
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment