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
bbcee544
Commit
bbcee544
authored
Jul 13, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have \dn+ show permissions and description for schemas.
Dennis Bjorklund
parent
dc0e76ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
15 deletions
+25
-15
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/ref/psql-ref.sgml
+4
-2
src/bin/psql/command.c
src/bin/psql/command.c
+2
-2
src/bin/psql/describe.c
src/bin/psql/describe.c
+15
-7
src/bin/psql/describe.h
src/bin/psql/describe.h
+2
-2
src/bin/psql/help.c
src/bin/psql/help.c
+2
-2
No files found.
doc/src/sgml/ref/psql-ref.sgml
View file @
bbcee544
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.11
7 2004/07/12 20:41:08
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.11
8 2004/07/13 16:48:15
momjian Exp $
PostgreSQL documentation
-->
...
...
@@ -990,7 +990,9 @@ testdb=>
Lists all available schemas (namespaces). If <replaceable
class="parameter">pattern</replaceable> (a regular expression)
is specified, only schemas whose names match the pattern are listed.
Non-local temporary schemas are suppressed.
Non-local temporary schemas are suppressed. If <literal>+</literal>
is appended to the command name, each object is listed with its associated
permissions and description, if any.
</para>
</listitem>
</varlistentry>
...
...
src/bin/psql/command.c
View file @
bbcee544
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.12
0 2004/07/11 21:34:03
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.12
1 2004/07/13 16:48:16
momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
...
...
@@ -326,7 +326,7 @@ exec_command(const char *cmd,
success
=
do_lo_list
();
break
;
case
'n'
:
success
=
listSchemas
(
pattern
);
success
=
listSchemas
(
pattern
,
show_verbose
);
break
;
case
'o'
:
success
=
describeOperators
(
pattern
);
...
...
src/bin/psql/describe.c
View file @
bbcee544
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.10
1 2004/07/13 02:46:21
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.10
2 2004/07/13 16:48:16
momjian Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
...
...
@@ -1693,7 +1693,7 @@ listCasts(const char *pattern)
* Describes schemas (namespaces)
*/
bool
listSchemas
(
const
char
*
pattern
)
listSchemas
(
const
char
*
pattern
,
bool
verbose
)
{
PQExpBufferData
buf
;
PGresult
*
res
;
...
...
@@ -1702,13 +1702,21 @@ listSchemas(const char *pattern)
initPQExpBuffer
(
&
buf
);
printfPQExpBuffer
(
&
buf
,
"SELECT n.nspname AS
\"
%s
\"
,
\n
"
" u.usename AS
\"
%s
\"\n
"
"FROM pg_catalog.pg_namespace n LEFT JOIN pg_catalog.pg_user u
\n
"
" u.usename AS
\"
%s
\"
"
,
_
(
"Name"
),
_
(
"Owner"
));
if
(
verbose
)
appendPQExpBuffer
(
&
buf
,
",
\n
n.nspacl as
\"
%s
\"
,"
" pg_catalog.obj_description(n.oid, 'pg_namespace') as
\"
%s
\"
"
,
_
(
"Access privileges"
),
_
(
"Description"
));
appendPQExpBuffer
(
&
buf
,
"
\n
FROM pg_catalog.pg_namespace n LEFT JOIN pg_catalog.pg_user u
\n
"
" ON n.nspowner=u.usesysid
\n
"
"WHERE (n.nspname NOT LIKE 'pg
\\\\
_temp
\\\\
_%%' OR
\n
"
" n.nspname = (pg_catalog.current_schemas(true))[1])
\n
"
,
/* temp schema is first */
_
(
"Name"
),
_
(
"Owner"
));
" n.nspname = (pg_catalog.current_schemas(true))[1])
\n
"
);
/* temp schema is first */
processNamePattern
(
&
buf
,
pattern
,
true
,
false
,
NULL
,
"n.nspname"
,
NULL
,
NULL
);
...
...
src/bin/psql/describe.h
View file @
bbcee544
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.h,v 1.2
4 2004/06/18 06:14:04 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.h,v 1.2
5 2004/07/13 16:48:16 momjian
Exp $
*/
#ifndef DESCRIBE_H
#define DESCRIBE_H
...
...
@@ -56,7 +56,7 @@ bool listConversions(const char *pattern);
bool
listCasts
(
const
char
*
pattern
);
/* \dn */
bool
listSchemas
(
const
char
*
pattern
);
bool
listSchemas
(
const
char
*
pattern
,
bool
verbose
);
#endif
/* DESCRIBE_H */
src/bin/psql/help.c
View file @
bbcee544
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.8
8 2004/06/18 06:14:04 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.8
9 2004/07/13 16:48:16 momjian
Exp $
*/
#include "postgres_fe.h"
#include "common.h"
...
...
@@ -218,7 +218,7 @@ slashUsage(unsigned short int pager)
fprintf
(
output
,
_
(
"
\\
dD [PATTERN] list domains
\n
"
));
fprintf
(
output
,
_
(
"
\\
df [PATTERN] list functions (add
\"
+
\"
for more detail)
\n
"
));
fprintf
(
output
,
_
(
"
\\
dg [PATTERN] list groups
\n
"
));
fprintf
(
output
,
_
(
"
\\
dn [PATTERN] list schemas
\n
"
));
fprintf
(
output
,
_
(
"
\\
dn [PATTERN] list schemas
(add
\"
+
\"
for more detail)
\n
"
));
fprintf
(
output
,
_
(
"
\\
do [NAME] list operators
\n
"
));
fprintf
(
output
,
_
(
"
\\
dl list large objects, same as
\\
lo_list
\n
"
));
fprintf
(
output
,
_
(
"
\\
dp [PATTERN] list table, view and sequence access privileges
\n
"
));
...
...
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