Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
bbcee544
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bbcee544
编写于
7月 13, 2004
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Have \dn+ show permissions and description for schemas.
Dennis Bjorklund
上级
dc0e76ca
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
15 deletion
+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
未找到文件。
doc/src/sgml/ref/psql-ref.sgml
浏览文件 @
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
PostgreSQL documentation
-->
-->
...
@@ -990,7 +990,9 @@ testdb=>
...
@@ -990,7 +990,9 @@ testdb=>
Lists all available schemas (namespaces). If <replaceable
Lists all available schemas (namespaces). If <replaceable
class="parameter">pattern</replaceable> (a regular expression)
class="parameter">pattern</replaceable> (a regular expression)
is specified, only schemas whose names match the pattern are listed.
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>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
...
src/bin/psql/command.c
浏览文件 @
bbcee544
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* 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 "postgres_fe.h"
#include "command.h"
#include "command.h"
...
@@ -326,7 +326,7 @@ exec_command(const char *cmd,
...
@@ -326,7 +326,7 @@ exec_command(const char *cmd,
success
=
do_lo_list
();
success
=
do_lo_list
();
break
;
break
;
case
'n'
:
case
'n'
:
success
=
listSchemas
(
pattern
);
success
=
listSchemas
(
pattern
,
show_verbose
);
break
;
break
;
case
'o'
:
case
'o'
:
success
=
describeOperators
(
pattern
);
success
=
describeOperators
(
pattern
);
...
...
src/bin/psql/describe.c
浏览文件 @
bbcee544
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* 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 "postgres_fe.h"
#include "describe.h"
#include "describe.h"
...
@@ -1693,7 +1693,7 @@ listCasts(const char *pattern)
...
@@ -1693,7 +1693,7 @@ listCasts(const char *pattern)
* Describes schemas (namespaces)
* Describes schemas (namespaces)
*/
*/
bool
bool
listSchemas
(
const
char
*
pattern
)
listSchemas
(
const
char
*
pattern
,
bool
verbose
)
{
{
PQExpBufferData
buf
;
PQExpBufferData
buf
;
PGresult
*
res
;
PGresult
*
res
;
...
@@ -1702,13 +1702,21 @@ listSchemas(const char *pattern)
...
@@ -1702,13 +1702,21 @@ listSchemas(const char *pattern)
initPQExpBuffer
(
&
buf
);
initPQExpBuffer
(
&
buf
);
printfPQExpBuffer
(
&
buf
,
printfPQExpBuffer
(
&
buf
,
"SELECT n.nspname AS
\"
%s
\"
,
\n
"
"SELECT n.nspname AS
\"
%s
\"
,
\n
"
" u.usename AS
\"
%s
\"\n
"
" u.usename AS
\"
%s
\"
"
,
"FROM pg_catalog.pg_namespace n LEFT JOIN pg_catalog.pg_user u
\n
"
_
(
"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
"
" ON n.nspowner=u.usesysid
\n
"
"WHERE (n.nspname NOT LIKE 'pg
\\\\
_temp
\\\\
_%%' OR
\n
"
"WHERE (n.nspname NOT LIKE 'pg
\\\\
_temp
\\\\
_%%' OR
\n
"
" n.nspname = (pg_catalog.current_schemas(true))[1])
\n
"
,
/* temp schema is first */
" n.nspname = (pg_catalog.current_schemas(true))[1])
\n
"
);
/* temp schema is first */
_
(
"Name"
),
_
(
"Owner"
));
processNamePattern
(
&
buf
,
pattern
,
true
,
false
,
processNamePattern
(
&
buf
,
pattern
,
true
,
false
,
NULL
,
"n.nspname"
,
NULL
,
NULL
,
"n.nspname"
,
NULL
,
NULL
);
NULL
);
...
...
src/bin/psql/describe.h
浏览文件 @
bbcee544
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* 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
#ifndef DESCRIBE_H
#define DESCRIBE_H
#define DESCRIBE_H
...
@@ -56,7 +56,7 @@ bool listConversions(const char *pattern);
...
@@ -56,7 +56,7 @@ bool listConversions(const char *pattern);
bool
listCasts
(
const
char
*
pattern
);
bool
listCasts
(
const
char
*
pattern
);
/* \dn */
/* \dn */
bool
listSchemas
(
const
char
*
pattern
);
bool
listSchemas
(
const
char
*
pattern
,
bool
verbose
);
#endif
/* DESCRIBE_H */
#endif
/* DESCRIBE_H */
src/bin/psql/help.c
浏览文件 @
bbcee544
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* 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 "postgres_fe.h"
#include "common.h"
#include "common.h"
...
@@ -218,7 +218,7 @@ slashUsage(unsigned short int pager)
...
@@ -218,7 +218,7 @@ slashUsage(unsigned short int pager)
fprintf
(
output
,
_
(
"
\\
dD [PATTERN] list domains
\n
"
));
fprintf
(
output
,
_
(
"
\\
dD [PATTERN] list domains
\n
"
));
fprintf
(
output
,
_
(
"
\\
df [PATTERN] list functions (add
\"
+
\"
for more detail)
\n
"
));
fprintf
(
output
,
_
(
"
\\
df [PATTERN] list functions (add
\"
+
\"
for more detail)
\n
"
));
fprintf
(
output
,
_
(
"
\\
dg [PATTERN] list groups
\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
,
_
(
"
\\
do [NAME] list operators
\n
"
));
fprintf
(
output
,
_
(
"
\\
dl list large objects, same as
\\
lo_list
\n
"
));
fprintf
(
output
,
_
(
"
\\
dl list large objects, same as
\\
lo_list
\n
"
));
fprintf
(
output
,
_
(
"
\\
dp [PATTERN] list table, view and sequence access privileges
\n
"
));
fprintf
(
output
,
_
(
"
\\
dp [PATTERN] list table, view and sequence access privileges
\n
"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录