Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
43d07d63
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,发现更多精彩内容 >>
提交
43d07d63
编写于
3月 07, 2010
作者:
M
Magnus Hagander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert patch for --psqlrc=FILENAME in psql.
上级
153012c7
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
31 deletion
+10
-31
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/ref/psql-ref.sgml
+1
-11
src/bin/psql/help.c
src/bin/psql/help.c
+1
-2
src/bin/psql/startup.c
src/bin/psql/startup.c
+8
-18
未找到文件。
doc/src/sgml/ref/psql-ref.sgml
浏览文件 @
43d07d63
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.24
0 2010/03/06 15:28:09
mha Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.24
1 2010/03/07 17:02:33
mha Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -481,16 +481,6 @@ PostgreSQL documentation
...
@@ -481,16 +481,6 @@ PostgreSQL documentation
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term><option>--psqlrc=<replaceable class="parameter">FILENAME</></></term>
<listitem>
<para>
Read the start-up file from <replaceable class="parameter">FILENAME</>
instead of <filename>~/.psqlrc</>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term><option>-1</option></term>
<term><option>-1</option></term>
<term><option>--single-transaction</option></term>
<term><option>--single-transaction</option></term>
...
...
src/bin/psql/help.c
浏览文件 @
43d07d63
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.15
6 2010/03/06 15:28:09
mha Exp $
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.15
7 2010/03/07 17:02:34
mha Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -99,7 +99,6 @@ usage(void)
...
@@ -99,7 +99,6 @@ usage(void)
printf
(
_
(
" -v, --set=, --variable=NAME=VALUE
\n
"
printf
(
_
(
" -v, --set=, --variable=NAME=VALUE
\n
"
" set psql variable NAME to VALUE
\n
"
));
" set psql variable NAME to VALUE
\n
"
));
printf
(
_
(
" -X, --no-psqlrc do not read startup file (~/.psqlrc)
\n
"
));
printf
(
_
(
" -X, --no-psqlrc do not read startup file (~/.psqlrc)
\n
"
));
printf
(
_
(
" --psqlrc=FILENAME read startup commands from file (instead of ~/.psqlrc)
\n
"
));
printf
(
_
(
" -1 (
\"
one
\"
), --single-transaction
\n
"
printf
(
_
(
" -1 (
\"
one
\"
), --single-transaction
\n
"
" execute command file as a single transaction
\n
"
));
" execute command file as a single transaction
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
...
...
src/bin/psql/startup.c
浏览文件 @
43d07d63
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.16
3 2010/03/06 15:28:09
mha Exp $
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.16
4 2010/03/07 17:02:34
mha Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -68,12 +68,11 @@ struct adhoc_opts
...
@@ -68,12 +68,11 @@ struct adhoc_opts
bool
no_readline
;
bool
no_readline
;
bool
no_psqlrc
;
bool
no_psqlrc
;
bool
single_txn
;
bool
single_txn
;
char
*
psqlrc
;
};
};
static
void
parse_psql_options
(
int
argc
,
char
*
argv
[],
static
void
parse_psql_options
(
int
argc
,
char
*
argv
[],
struct
adhoc_opts
*
options
);
struct
adhoc_opts
*
options
);
static
void
process_psqlrc
(
char
*
argv0
,
struct
adhoc_opts
*
options
);
static
void
process_psqlrc
(
char
*
argv0
);
static
void
process_psqlrc_file
(
char
*
filename
);
static
void
process_psqlrc_file
(
char
*
filename
);
static
void
showVersion
(
void
);
static
void
showVersion
(
void
);
static
void
EstablishVariableSpace
(
void
);
static
void
EstablishVariableSpace
(
void
);
...
@@ -248,7 +247,8 @@ main(int argc, char *argv[])
...
@@ -248,7 +247,8 @@ main(int argc, char *argv[])
*/
*/
if
(
options
.
action
==
ACT_FILE
)
if
(
options
.
action
==
ACT_FILE
)
{
{
process_psqlrc
(
argv
[
0
],
&
options
);
if
(
!
options
.
no_psqlrc
)
process_psqlrc
(
argv
[
0
]);
successResult
=
process_file
(
options
.
action_string
,
options
.
single_txn
);
successResult
=
process_file
(
options
.
action_string
,
options
.
single_txn
);
}
}
...
@@ -291,7 +291,8 @@ main(int argc, char *argv[])
...
@@ -291,7 +291,8 @@ main(int argc, char *argv[])
*/
*/
else
else
{
{
process_psqlrc
(
argv
[
0
],
&
options
);
if
(
!
options
.
no_psqlrc
)
process_psqlrc
(
argv
[
0
]);
connection_warnings
(
true
);
connection_warnings
(
true
);
if
(
!
pset
.
quiet
&&
!
pset
.
notty
)
if
(
!
pset
.
quiet
&&
!
pset
.
notty
)
...
@@ -354,7 +355,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -354,7 +355,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
{
"password"
,
no_argument
,
NULL
,
'W'
},
{
"password"
,
no_argument
,
NULL
,
'W'
},
{
"expanded"
,
no_argument
,
NULL
,
'x'
},
{
"expanded"
,
no_argument
,
NULL
,
'x'
},
{
"no-psqlrc"
,
no_argument
,
NULL
,
'X'
},
{
"no-psqlrc"
,
no_argument
,
NULL
,
'X'
},
{
"psqlrc"
,
required_argument
,
NULL
,
1
},
{
"help"
,
no_argument
,
NULL
,
'?'
},
{
"help"
,
no_argument
,
NULL
,
'?'
},
{
NULL
,
0
,
NULL
,
0
}
{
NULL
,
0
,
NULL
,
0
}
};
};
...
@@ -515,9 +515,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -515,9 +515,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
case
'X'
:
case
'X'
:
options
->
no_psqlrc
=
true
;
options
->
no_psqlrc
=
true
;
break
;
break
;
case
1
:
options
->
psqlrc
=
pg_strdup
(
optarg
);
break
;
case
'1'
:
case
'1'
:
options
->
single_txn
=
true
;
options
->
single_txn
=
true
;
break
;
break
;
...
@@ -566,27 +563,20 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -566,27 +563,20 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
* Load .psqlrc file, if found.
* Load .psqlrc file, if found.
*/
*/
static
void
static
void
process_psqlrc
(
char
*
argv0
,
struct
adhoc_opts
*
options
)
process_psqlrc
(
char
*
argv0
)
{
{
char
home
[
MAXPGPATH
];
char
home
[
MAXPGPATH
];
char
rc_file
[
MAXPGPATH
];
char
rc_file
[
MAXPGPATH
];
char
my_exec_path
[
MAXPGPATH
];
char
my_exec_path
[
MAXPGPATH
];
char
etc_path
[
MAXPGPATH
];
char
etc_path
[
MAXPGPATH
];
if
(
options
->
no_psqlrc
)
return
;
find_my_exec
(
argv0
,
my_exec_path
);
find_my_exec
(
argv0
,
my_exec_path
);
get_etc_path
(
my_exec_path
,
etc_path
);
get_etc_path
(
my_exec_path
,
etc_path
);
snprintf
(
rc_file
,
MAXPGPATH
,
"%s/%s"
,
etc_path
,
SYSPSQLRC
);
snprintf
(
rc_file
,
MAXPGPATH
,
"%s/%s"
,
etc_path
,
SYSPSQLRC
);
process_psqlrc_file
(
rc_file
);
process_psqlrc_file
(
rc_file
);
if
(
options
->
psqlrc
)
if
(
get_home_path
(
home
))
{
process_psqlrc_file
(
options
->
psqlrc
);
}
else
if
(
get_home_path
(
home
))
{
{
snprintf
(
rc_file
,
MAXPGPATH
,
"%s/%s"
,
home
,
PSQLRC
);
snprintf
(
rc_file
,
MAXPGPATH
,
"%s/%s"
,
home
,
PSQLRC
);
process_psqlrc_file
(
rc_file
);
process_psqlrc_file
(
rc_file
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录