Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
4cbc06cf
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,发现更多精彩内容 >>
提交
4cbc06cf
编写于
11月 14, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add new psql \da, \do, and \dT options.
上级
208dae37
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
106 addition
and
51 deletion
+106
-51
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+5
-4
src/bin/psql/psql.c
src/bin/psql/psql.c
+89
-43
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+3
-1
src/man/psql.1
src/man/psql.1
+9
-3
src/tools/backend/flow.gif
src/tools/backend/flow.gif
+0
-0
未找到文件。
src/bin/initdb/initdb.sh
浏览文件 @
4cbc06cf
...
...
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.2
5 1997/11/13 03:22:34
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.2
6 1997/11/14 21:37:35
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -346,11 +346,12 @@ fi
echo
echo
"loading pg_description"
echo
"copy pg_description from '
$TEMPLATE_DESCR
'"
| postgres
-F
-Q
-D
$PGDATA
template1
>
/dev/null
echo
"copy pg_description from '
$GLOBAL_DESCR
'"
| postgres
-F
-Q
-D
$PGDATA
template1
>
/dev/null
echo
"vacuuming template1"
echo
"vacuum"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
grep
-v
"^DEBUG:"
echo
"loading pg_description"
echo
"copy pg_description from '
$TEMPLATE_DESCR
'"
| postgres
-F
-Q
-D
$PGDATA
template1
>
/dev/null
echo
"copy pg_description from '
$GLOBAL_DESCR
'"
| postgres
-F
-Q
-D
$PGDATA
template1
>
/dev/null
src/bin/psql/psql.c
浏览文件 @
4cbc06cf
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.10
4 1997/11/14 05:57:35
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.10
5 1997/11/14 21:37:41
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -135,14 +135,6 @@ HandleSlashCmds(PsqlSettings *pset,
char
*
line
,
char
*
query
);
static
int
MainLoop
(
PsqlSettings
*
pset
,
char
*
query
,
FILE
*
source
);
/* probably should move this into libpq */
void
PQprint
(
FILE
*
fp
,
PGresult
*
res
,
PQprintOpt
*
po
);
static
FILE
*
setFout
(
PsqlSettings
*
pset
,
char
*
fname
);
/*
...
...
@@ -224,11 +216,14 @@ slashUsage(PsqlSettings *pset)
fprintf
(
fout
,
"
\\
C [<captn>] -- set html3 caption (currently '%s')
\n
"
,
pset
->
opt
.
caption
?
pset
->
opt
.
caption
:
""
);
fprintf
(
fout
,
"
\\
connect <dbname|-> <user> -- connect to new database (currently '%s')
\n
"
,
PQdb
(
pset
->
db
));
fprintf
(
fout
,
"
\\
copy table {from | to} <fname>
\n
"
);
fprintf
(
fout
,
"
\\
d [<table>] -- list tables and indices in database or columns in <table>, * for all
\n
"
);
fprintf
(
fout
,
"
\\
d [<table>] -- list tables and indices, columns in <table>, or * for all
\n
"
);
fprintf
(
fout
,
"
\\
da -- list aggregates
\n
"
);
fprintf
(
fout
,
"
\\
dd [<object>]- list comment for table, field, type, function, or operator.
\n
"
);
fprintf
(
fout
,
"
\\
di -- list only indices in database
\n
"
);
fprintf
(
fout
,
"
\\
ds -- list only sequences in database
\n
"
);
fprintf
(
fout
,
"
\\
dt -- list only tables in database
\n
"
);
fprintf
(
fout
,
"
\\
di -- list only indices
\n
"
);
fprintf
(
fout
,
"
\\
do -- list operators
\n
"
);
fprintf
(
fout
,
"
\\
ds -- list only sequences
\n
"
);
fprintf
(
fout
,
"
\\
dt -- list only tables
\n
"
);
fprintf
(
fout
,
"
\\
dT -- list types
\n
"
);
fprintf
(
fout
,
"
\\
e [<fname>] -- edit the current query buffer or <fname>
\n
"
);
fprintf
(
fout
,
"
\\
E [<fname>] -- edit the current query buffer or <fname>, and execute
\n
"
);
fprintf
(
fout
,
"
\\
f [<sep>] -- change field separater (currently '%s')
\n
"
,
pset
->
opt
.
fieldSep
);
...
...
@@ -751,23 +746,10 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout)
strcat
(
descbuf
,
"FROM pg_type, pg_description "
);
strcat
(
descbuf
,
"WHERE pg_type.typname = '"
);
strcat
(
descbuf
,
object
);
strcat
(
descbuf
,
"'"
);
strcat
(
descbuf
,
" and pg_type.oid = pg_description.objoid "
);
if
(
!
(
res
=
PSQLexec
(
pset
,
descbuf
)))
return
-
1
;
else
if
(
PQntuples
(
res
)
<=
0
)
{
PQclear
(
res
);
descbuf
[
0
]
=
'\0'
;
strcat
(
descbuf
,
"SELECT DISTINCT description "
);
strcat
(
descbuf
,
"FROM pg_type, pg_description "
);
strcat
(
descbuf
,
"WHERE pg_type.typname = '"
);
strcat
(
descbuf
,
object
);
strcat
(
descbuf
,
"'"
);
strcat
(
descbuf
,
" and pg_type.oid = pg_description.objoid "
);
strcat
(
descbuf
,
"' and "
);
strcat
(
descbuf
,
" pg_type.oid = pg_description.objoid "
);
if
(
!
(
res
=
PSQLexec
(
pset
,
descbuf
)))
return
-
1
;
else
if
(
PQntuples
(
res
)
<=
0
)
{
PQclear
(
res
);
descbuf
[
0
]
=
'\0'
;
...
...
@@ -808,7 +790,6 @@ objectDescription(PsqlSettings *pset, char *object, FILE *fout)
}
}
}
}
nDescriptions
=
PQntuples
(
res
);
if
(
nDescriptions
>
0
)
{
...
...
@@ -1584,7 +1565,7 @@ HandleSlashCmds(PsqlSettings *pset,
{
int
status
=
CMD_SKIP_LINE
;
char
*
optarg
;
bool
success
;
/*
* Pointer inside the <cmd> string to the argument of the slash
* command, assuming it is a one-character slash command. If it's not
...
...
@@ -1696,20 +1677,82 @@ HandleSlashCmds(PsqlSettings *pset,
}
}
break
;
case
'd'
:
/* \d describe tables or columns in a
* table */
if
(
strncmp
(
cmd
,
"dd"
,
2
)
==
0
)
case
'd'
:
/* \d describe database information */
if
(
strncmp
(
cmd
,
"da"
,
2
)
==
0
)
/* aggregates */
SendQuery
(
&
success
,
pset
,
"\
SELECT a.aggname AS aggname, \
t.typname AS typname, \
obj_description(a.oid) as description \
FROM pg_aggregate a, pg_type t \
WHERE a.aggbasetype = t.oid \
ORDER BY aggname, typname;"
,
false
,
false
,
0
);
else
if
(
strncmp
(
cmd
,
"dd"
,
2
)
==
0
)
/* descriptions */
objectDescription
(
pset
,
optarg
+
1
,
NULL
);
else
if
(
strncmp
(
cmd
,
"di"
,
2
)
==
0
)
/* only indices */
tableList
(
pset
,
false
,
'i'
);
else
if
(
strncmp
(
cmd
,
"do"
,
2
)
==
0
)
{
/* operators */
SendQuery
(
&
success
,
pset
,
"\
SELECT t0.typname AS result, \
t1.typname AS left_type, \
t2.typname AS right_type, \
o.oprname AS operatr, \
p.proname AS func_name, \
obj_description(o.oid) as description \
FROM pg_proc p, pg_type t0, \
pg_type t1, pg_type t2, \
pg_operator o \
WHERE p.prorettype = t0.oid AND \
RegprocToOid(o.oprcode) = p.oid AND \
p.pronargs = 2 AND \
o.oprleft = t1.oid AND \
o.oprright = t2.oid \
ORDER BY result, left_type, right_type, operatr;"
,
false
,
false
,
0
);
SendQuery
(
&
success
,
pset
,
"\
SELECT o.oprname AS left_unary, \
t.typname AS operand, \
r.typname AS return_type, \
obj_description(o.oid) as description \
FROM pg_operator o, pg_type t, pg_type r \
WHERE o.oprkind = 'l' AND \
o.oprright = t.oid AND \
o.oprresult = r.oid \
ORDER BY operand;"
,
false
,
false
,
0
);
SendQuery
(
&
success
,
pset
,
"\
SELECT o.oprname AS right_unary, \
t.typname AS operand, \
r.typname AS return_type, \
obj_description(o.oid) as description \
FROM pg_operator o, pg_type t, pg_type r \
WHERE o.oprkind = 'r' AND \
o.oprleft = t.oid AND \
o.oprresult = r.oid \
ORDER BY operand;"
,
false
,
false
,
0
);
}
else
if
(
strncmp
(
cmd
,
"ds"
,
2
)
==
0
)
/* only sequences */
tableList
(
pset
,
false
,
'S'
);
else
if
(
strncmp
(
cmd
,
"dt"
,
2
)
==
0
)
/* only tables */
tableList
(
pset
,
false
,
't'
);
else
if
(
strncmp
(
cmd
,
"dT"
,
2
)
==
0
)
/* types */
SendQuery
(
&
success
,
pset
,
"\
SELECT typname AS type, \
obj_description(oid) as description \
FROM pg_type \
WHERE typrelid = 0 AND \
typname !~ '^_.*' \
ORDER BY type;"
,
false
,
false
,
0
);
else
if
(
!
optarg
)
/* show tables, sequences and indices */
tableList
(
pset
,
false
,
'b'
);
...
...
@@ -1718,9 +1761,12 @@ HandleSlashCmds(PsqlSettings *pset,
if
(
tableList
(
pset
,
false
,
'b'
)
==
0
)
tableList
(
pset
,
true
,
'b'
);
}
else
else
if
(
strncmp
(
cmd
,
"d "
,
2
)
==
0
)
/* describe the specified table */
tableDesc
(
pset
,
optarg
,
NULL
);
else
slashUsage
(
pset
);
break
;
case
'e'
:
/* edit */
{
...
...
src/include/catalog/pg_proc.h
浏览文件 @
4cbc06cf
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_proc.h,v 1.3
4 1997/11/13 03:23:07
momjian Exp $
* $Id: pg_proc.h,v 1.3
5 1997/11/14 21:37:54
momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
...
...
@@ -1649,6 +1649,8 @@ DATA(insert OID = 1346 ( int2 PGUID 14 f t f 1 f 21 "25" 100 0 0 100 "sele
DESCR
(
""
);
DATA
(
insert
OID
=
1347
(
int4
PGUID
14
f
t
f
1
f
23
"25"
100
0
0
100
"select text_int4($1)"
-
));
DESCR
(
""
);
DATA
(
insert
OID
=
1348
(
obj_description
PGUID
14
f
t
f
1
f
25
"26"
100
0
0
100
"select description from pg_description where objoid = $1"
-
));
DESCR
(
""
);
DATA
(
insert
OID
=
1350
(
datetime
PGUID
14
f
t
f
1
f
1184
"1184"
100
0
0
100
"select $1"
-
));
DESCR
(
""
);
...
...
src/man/psql.1
浏览文件 @
4cbc06cf
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/psql.1,v 1.1
4 1997/11/13 03:36:42
momjian Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/psql.1,v 1.1
5 1997/11/14 21:38:16
momjian Exp $
.TH PSQL UNIX 1/20/96 PostgreSQL PostgreSQL
.SH NAME
psql \(em run the interactive query front-end
...
...
@@ -292,14 +292,20 @@ is specified, list the columns in
If table name is
.IR *,
list all tables and column information for each tables.
.IP "\eda"
List aggregates.
.IP "\edd object"
List the description of the table, table.column, type, operator, or aggregate.
.IP "\edi"
List only indexes.
.IP "\ed
t
"
List o
nly table
s.
.IP "\ed
o
"
List o
perator
s.
.IP "\eds"
List only sequences.
.IP "\edt"
List only tables.
.IP "\edT"
List types.
.IP "\ee [\fIfilename\fR]"
Edit the current query buffer or \fIfile\fR.
.IP "\eE [\fIfilename\fR]"
...
...
src/tools/backend/flow.gif
查看替换文件 @
208dae37
浏览文件 @
4cbc06cf
658.3 KB
|
W:
|
H:
7.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录