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
43d07d63
Commit
43d07d63
authored
Mar 07, 2010
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert patch for --psqlrc=FILENAME in psql.
parent
153012c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
31 deletions
+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
No files found.
doc/src/sgml/ref/psql-ref.sgml
View file @
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
-->
...
...
@@ -481,16 +481,6 @@ PostgreSQL documentation
</listitem>
</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>
<term><option>-1</option></term>
<term><option>--single-transaction</option></term>
...
...
src/bin/psql/help.c
View file @
43d07d63
...
...
@@ -3,7 +3,7 @@
*
* 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"
...
...
@@ -99,7 +99,6 @@ usage(void)
printf
(
_
(
" -v, --set=, --variable=NAME=VALUE
\n
"
" set psql variable NAME to VALUE
\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
"
" execute command file as a single transaction
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
...
...
src/bin/psql/startup.c
View file @
43d07d63
...
...
@@ -3,7 +3,7 @@
*
* 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"
...
...
@@ -68,12 +68,11 @@ struct adhoc_opts
bool
no_readline
;
bool
no_psqlrc
;
bool
single_txn
;
char
*
psqlrc
;
};
static
void
parse_psql_options
(
int
argc
,
char
*
argv
[],
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
showVersion
(
void
);
static
void
EstablishVariableSpace
(
void
);
...
...
@@ -248,7 +247,8 @@ main(int argc, char *argv[])
*/
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
);
}
...
...
@@ -291,7 +291,8 @@ main(int argc, char *argv[])
*/
else
{
process_psqlrc
(
argv
[
0
],
&
options
);
if
(
!
options
.
no_psqlrc
)
process_psqlrc
(
argv
[
0
]);
connection_warnings
(
true
);
if
(
!
pset
.
quiet
&&
!
pset
.
notty
)
...
...
@@ -354,7 +355,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
{
"password"
,
no_argument
,
NULL
,
'W'
},
{
"expanded"
,
no_argument
,
NULL
,
'x'
},
{
"no-psqlrc"
,
no_argument
,
NULL
,
'X'
},
{
"psqlrc"
,
required_argument
,
NULL
,
1
},
{
"help"
,
no_argument
,
NULL
,
'?'
},
{
NULL
,
0
,
NULL
,
0
}
};
...
...
@@ -515,9 +515,6 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
case
'X'
:
options
->
no_psqlrc
=
true
;
break
;
case
1
:
options
->
psqlrc
=
pg_strdup
(
optarg
);
break
;
case
'1'
:
options
->
single_txn
=
true
;
break
;
...
...
@@ -566,27 +563,20 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
* Load .psqlrc file, if found.
*/
static
void
process_psqlrc
(
char
*
argv0
,
struct
adhoc_opts
*
options
)
process_psqlrc
(
char
*
argv0
)
{
char
home
[
MAXPGPATH
];
char
rc_file
[
MAXPGPATH
];
char
my_exec_path
[
MAXPGPATH
];
char
etc_path
[
MAXPGPATH
];
if
(
options
->
no_psqlrc
)
return
;
find_my_exec
(
argv0
,
my_exec_path
);
get_etc_path
(
my_exec_path
,
etc_path
);
snprintf
(
rc_file
,
MAXPGPATH
,
"%s/%s"
,
etc_path
,
SYSPSQLRC
);
process_psqlrc_file
(
rc_file
);
if
(
options
->
psqlrc
)
{
process_psqlrc_file
(
options
->
psqlrc
);
}
else
if
(
get_home_path
(
home
))
if
(
get_home_path
(
home
))
{
snprintf
(
rc_file
,
MAXPGPATH
,
"%s/%s"
,
home
,
PSQLRC
);
process_psqlrc_file
(
rc_file
);
...
...
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