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
c154fc3a
Commit
c154fc3a
authored
Jul 23, 2003
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply message style guide to frontend programs.
parent
a0743b13
Changes
30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
325 additions
and
331 deletions
+325
-331
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+31
-30
src/bin/initlocation/initlocation.sh
src/bin/initlocation/initlocation.sh
+16
-15
src/bin/ipcclean/ipcclean.sh
src/bin/ipcclean/ipcclean.sh
+6
-5
src/bin/pg_config/pg_config.sh
src/bin/pg_config/pg_config.sh
+2
-2
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_controldata/pg_controldata.c
+9
-9
src/bin/pg_ctl/pg_ctl.sh
src/bin/pg_ctl/pg_ctl.sh
+9
-9
src/bin/pg_dump/common.c
src/bin/pg_dump/common.c
+8
-8
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+24
-24
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+9
-9
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_db.c
+4
-4
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+6
-6
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+53
-53
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+11
-11
src/bin/pg_dump/pg_restore.c
src/bin/pg_dump/pg_restore.c
+3
-3
src/bin/pg_resetxlog/pg_resetxlog.c
src/bin/pg_resetxlog/pg_resetxlog.c
+24
-24
src/bin/psql/command.c
src/bin/psql/command.c
+15
-15
src/bin/psql/common.c
src/bin/psql/common.c
+3
-3
src/bin/psql/copy.c
src/bin/psql/copy.c
+2
-2
src/bin/psql/describe.c
src/bin/psql/describe.c
+11
-24
src/bin/psql/help.c
src/bin/psql/help.c
+28
-24
src/bin/psql/input.c
src/bin/psql/input.c
+2
-2
src/bin/psql/startup.c
src/bin/psql/startup.c
+7
-7
src/bin/scripts/clusterdb.c
src/bin/scripts/clusterdb.c
+6
-6
src/bin/scripts/createdb.c
src/bin/scripts/createdb.c
+4
-4
src/bin/scripts/createlang.c
src/bin/scripts/createlang.c
+5
-5
src/bin/scripts/createuser.c
src/bin/scripts/createuser.c
+4
-4
src/bin/scripts/dropdb.c
src/bin/scripts/dropdb.c
+6
-6
src/bin/scripts/droplang.c
src/bin/scripts/droplang.c
+7
-7
src/bin/scripts/dropuser.c
src/bin/scripts/dropuser.c
+6
-6
src/bin/scripts/vacuumdb.c
src/bin/scripts/vacuumdb.c
+4
-4
No files found.
src/bin/initdb/initdb.sh
View file @
c154fc3a
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
# Portions Copyright (c) 1994, Regents of the University of California
#
#
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.19
7 2003/07/22 00:02:55 momjian
Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.19
8 2003/07/23 08:46:54 petere
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -39,14 +39,14 @@
...
@@ -39,14 +39,14 @@
exit_nicely
(){
exit_nicely
(){
stty echo
>
/dev/null 2>&1
stty echo
>
/dev/null 2>&1
echo
1>&2
echo
1>&2
echo
"
$CMDNAME
failed.
"
1>&2
echo
"
$CMDNAME
: failed
"
1>&2
if
[
"
$noclean
"
!=
yes
]
;
then
if
[
"
$noclean
"
!=
yes
]
;
then
if
[
"
$made_new_pgdata
"
=
yes
]
;
then
if
[
"
$made_new_pgdata
"
=
yes
]
;
then
echo
"
Removing
$PGDATA
.
"
1>&2
echo
"
$CMDNAME
: removing data directory
\"
$PGDATA
\"
"
1>&2
rm
-rf
"
$PGDATA
"
||
echo
"
Failed.
"
1>&2
rm
-rf
"
$PGDATA
"
||
echo
"
$CMDNAME
: failed
"
1>&2
fi
fi
else
else
echo
"
Data directory
$PGDATA
will not be removed at user's request.
"
1>&2
echo
"
$CMDNAME
: data directory
\"
$PGDATA
\"
not removed at user's request
"
1>&2
fi
fi
exit
1
exit
1
}
}
...
@@ -135,7 +135,7 @@ elif [ -x "$bindir/postgres" ]; then
...
@@ -135,7 +135,7 @@ elif [ -x "$bindir/postgres" ]; then
errormsg
=
`
$bindir
/postgres
-V
2>&1
>
/dev/null
`
errormsg
=
`
$bindir
/postgres
-V
2>&1
>
/dev/null
`
(
(
echo
"The program "
echo
"The program "
echo
"
'
$bindir
/postgres'
"
echo
"
$bindir
/postgres
"
echo
"needed by
$CMDNAME
does not belong to PostgreSQL version
$VERSION
, or"
echo
"needed by
$CMDNAME
does not belong to PostgreSQL version
$VERSION
, or"
echo
"there may be a configuration problem."
echo
"there may be a configuration problem."
if
test
x
"
$errormsg
"
!=
x
""
;
then
if
test
x
"
$errormsg
"
!=
x
""
;
then
...
@@ -147,8 +147,8 @@ elif [ -x "$bindir/postgres" ]; then
...
@@ -147,8 +147,8 @@ elif [ -x "$bindir/postgres" ]; then
exit
1
exit
1
fi
fi
else
else
echo
"The program
'postgres'
is needed by
$CMDNAME
but was not found in"
1>&2
echo
"The program
\"
postgres
\"
is needed by
$CMDNAME
but was not found in"
1>&2
echo
"the directory
'
$bindir
'
. Check your installation."
1>&2
echo
"the directory
\"
$bindir
\"
. Check your installation."
1>&2
exit
1
exit
1
fi
fi
...
@@ -156,8 +156,8 @@ fi
...
@@ -156,8 +156,8 @@ fi
# Now we can assume that 'pg_id' belongs to the same version as the
# Now we can assume that 'pg_id' belongs to the same version as the
# verified 'postgres' in the same directory.
# verified 'postgres' in the same directory.
if
[
!
-x
"
$PGPATH
/pg_id"
]
;
then
if
[
!
-x
"
$PGPATH
/pg_id"
]
;
then
echo
"The program
'pg_id'
is needed by
$CMDNAME
but was not found in"
1>&2
echo
"The program
\"
pg_id
\"
is needed by
$CMDNAME
but was not found in"
1>&2
echo
"the directory
'
$PGPATH
'
. Check your installation."
1>&2
echo
"the directory
\"
$PGPATH
\"
. Check your installation."
1>&2
exit
1
exit
1
fi
fi
...
@@ -170,8 +170,9 @@ fi
...
@@ -170,8 +170,9 @@ fi
if
[
`
$PGPATH
/pg_id
-u
`
-eq
0
]
if
[
`
$PGPATH
/pg_id
-u
`
-eq
0
]
then
then
echo
"You cannot run
$CMDNAME
as root. Please log in (using, e.g., 'su')"
1>&2
echo
"
$CMDNAME
: cannot be run as root"
1>&2
echo
"as the (unprivileged) user that will own the server process."
1>&2
echo
"Please log in (using, e.g.,
\"
su
\"
) as the (unprivileged) user that will"
1>&2
echo
"own the server process."
1>&2
exit
1
exit
1
fi
fi
...
@@ -215,14 +216,14 @@ do
...
@@ -215,14 +216,14 @@ do
;;
;;
--debug
|
-d
)
--debug
|
-d
)
debug
=
yes
debug
=
yes
echo
"Running
with debug mode on
."
echo
"Running
in debug mode
."
;;
;;
--show
|
-s
)
--show
|
-s
)
show_setting
=
yes
show_setting
=
yes
;;
;;
--noclean
|
-n
)
--noclean
|
-n
)
noclean
=
yes
noclean
=
yes
echo
"Running
with noclean mode on.
Mistakes will not be cleaned up."
echo
"Running
in noclean mode.
Mistakes will not be cleaned up."
;;
;;
# The name of the database superuser. Can be freely changed.
# The name of the database superuser. Can be freely changed.
--username
|
-U
)
--username
|
-U
)
...
@@ -319,7 +320,7 @@ do
...
@@ -319,7 +320,7 @@ do
-
*
)
-
*
)
echo
"
$CMDNAME
: invalid option:
$1
"
echo
"
$CMDNAME
: invalid option:
$1
"
echo
"Try
'
$CMDNAME
--help'
for more information."
echo
"Try
\"
$CMDNAME
--help
\"
for more information."
exit
1
exit
1
;;
;;
...
@@ -381,7 +382,7 @@ then
...
@@ -381,7 +382,7 @@ then
fi
fi
if
[
-z
"
$ENCODINGID
"
]
if
[
-z
"
$ENCODINGID
"
]
then
then
echo
"
$CMDNAME
:
$ENCODING
is not a valid backend
encoding name"
1>&2
echo
"
$CMDNAME
:
\"
$ENCODING
\"
is not a valid server
encoding name"
1>&2
exit
1
exit
1
fi
fi
fi
fi
...
@@ -394,9 +395,10 @@ fi
...
@@ -394,9 +395,10 @@ fi
if
[
-z
"
$PGDATA
"
]
if
[
-z
"
$PGDATA
"
]
then
then
(
(
echo
"
$CMDNAME
: You must identify where the the data for this database"
echo
"
$CMDNAME
: no data directory specified"
echo
"system will reside. Do this with either a -D invocation"
echo
"You must identify the directory where the data for this database system"
echo
"option or a PGDATA environment variable."
echo
"will reside. Do this with either the invocation option -D or the"
echo
"environment variable PGDATA."
)
1>&2
)
1>&2
exit
1
exit
1
fi
fi
...
@@ -417,7 +419,7 @@ if [ "$show_setting" = yes ] || [ "$debug" = yes ]
...
@@ -417,7 +419,7 @@ if [ "$show_setting" = yes ] || [ "$debug" = yes ]
then
then
(
(
echo
echo
echo
"
initdb
variables:"
echo
"
$CMDNAME
: internal
variables:"
for
var
in
PGDATA datadir PGPATH ENCODING ENCODINGID
\
for
var
in
PGDATA datadir PGPATH ENCODING ENCODINGID
\
POSTGRES_SUPERUSERNAME POSTGRES_BKI
\
POSTGRES_SUPERUSERNAME POSTGRES_BKI
\
POSTGRES_DESCR POSTGRESQL_CONF_SAMPLE
\
POSTGRES_DESCR POSTGRESQL_CONF_SAMPLE
\
...
@@ -436,9 +438,9 @@ for PREREQ_FILE in "$POSTGRES_BKI" "$POSTGRES_DESCR" \
...
@@ -436,9 +438,9 @@ for PREREQ_FILE in "$POSTGRES_BKI" "$POSTGRES_DESCR" \
do
do
if
[
!
-f
"
$PREREQ_FILE
"
]
;
then
if
[
!
-f
"
$PREREQ_FILE
"
]
;
then
(
(
echo
"
$CMDNAME
does not find the file '
$PREREQ_FILE
'.
"
echo
"
$CMDNAME
: file
\"
$PREREQ_FILE
\"
not found
"
echo
"This means you have a corrupted installation or identified the"
echo
"This means you have a corrupted installation or identified the"
echo
"wrong directory with the
-L invocation option
."
echo
"wrong directory with the
invocation option -L
."
)
1>&2
)
1>&2
exit
1
exit
1
fi
fi
...
@@ -448,9 +450,8 @@ for file in "$POSTGRES_BKI"
...
@@ -448,9 +450,8 @@ for file in "$POSTGRES_BKI"
do
do
if
[
x
"
`
sed
1q
$file
`
"
!=
x
"# PostgreSQL
$short_version
"
]
;
then
if
[
x
"
`
sed
1q
$file
`
"
!=
x
"# PostgreSQL
$short_version
"
]
;
then
(
(
echo
"The input file '
$file
' needed by
$CMDNAME
does not"
echo
"
$CMDNAME
: input file
\"
$file
\"
does not belong to PostgreSQL
$VERSION
"
echo
"belong to PostgreSQL
$VERSION
. Check your installation or specify the"
echo
"Check your installation or specify the correct path using the option -L."
echo
"correct path using the -L option."
)
1>&2
)
1>&2
exit
1
exit
1
fi
fi
...
@@ -493,10 +494,10 @@ pgdata_contents=`ls -A "$PGDATA" 2>/dev/null`
...
@@ -493,10 +494,10 @@ pgdata_contents=`ls -A "$PGDATA" 2>/dev/null`
if
[
x
"
$pgdata_contents
"
!=
x
]
if
[
x
"
$pgdata_contents
"
!=
x
]
then
then
(
(
echo
"
$CMDNAME
:
The directory
$PGDATA
exists but is not empty.
"
echo
"
$CMDNAME
:
directory
\"
$PGDATA
\"
exists but is not empty
"
echo
"If you want to create a new database system, either remove or empty"
echo
"If you want to create a new database system, either remove or empty"
echo
"the directory
$PGDATA
or run initdb with
"
echo
"the directory
\"
$PGDATA
\"
or run
$CMDNAME
with an argument other than
"
echo
"
an argument other than
$PGDATA
."
echo
"
\"
$PGDATA
\"
."
)
1>&2
)
1>&2
exit
1
exit
1
else
else
...
@@ -505,7 +506,7 @@ else
...
@@ -505,7 +506,7 @@ else
mkdir
-p
"
$PGDATA
"
>
/dev/null 2>&1
||
mkdir
"
$PGDATA
"
||
exit_nicely
mkdir
-p
"
$PGDATA
"
>
/dev/null 2>&1
||
mkdir
"
$PGDATA
"
||
exit_nicely
made_new_pgdata
=
yes
made_new_pgdata
=
yes
else
else
$ECHO_N
"
F
ixing permissions on existing directory
$PGDATA
... "
$ECHO_C
$ECHO_N
"
f
ixing permissions on existing directory
$PGDATA
... "
$ECHO_C
chmod
go-rwx
"
$PGDATA
"
||
exit_nicely
chmod
go-rwx
"
$PGDATA
"
||
exit_nicely
fi
fi
echo
"ok"
echo
"ok"
...
@@ -685,7 +686,7 @@ EOF
...
@@ -685,7 +686,7 @@ EOF
fi
fi
if
[
!
-f
"
$PGDATA
"
/global/pg_pwd
]
;
then
if
[
!
-f
"
$PGDATA
"
/global/pg_pwd
]
;
then
echo
echo
echo
"The password file wasn't generated. Please report this problem."
1>&2
echo
"
$CMDNAME
:
The password file wasn't generated. Please report this problem."
1>&2
exit_nicely
exit_nicely
fi
fi
echo
"ok"
echo
"ok"
...
...
src/bin/initlocation/initlocation.sh
View file @
c154fc3a
...
@@ -9,12 +9,12 @@
...
@@ -9,12 +9,12 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.1
5 2002/10/18 22:05:35
petere Exp $
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.1
6 2003/07/23 08:46:57
petere Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
exit_nicely
(){
exit_nicely
(){
echo
"
$CMDNAME
failed."
echo
"
$CMDNAME
: failed"
1>&2
rm
-rf
"
$PGALTDATA
"
rm
-rf
"
$PGALTDATA
"
exit
1
exit
1
}
}
...
@@ -25,8 +25,9 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
...
@@ -25,8 +25,9 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
if
[
"
$USER
"
=
'root'
-o
"
$LOGNAME
"
=
'root'
]
if
[
"
$USER
"
=
'root'
-o
"
$LOGNAME
"
=
'root'
]
then
then
echo
"You cannot run
$CMDNAME
as root. Please log in (using, e.g., 'su')"
echo
"
$CMDNAME
: cannot be run as root"
1>&2
echo
"as the (unprivileged) user that will own the server process."
echo
"Please log in (using, e.g.,
\"
su
\"
) as the (unprivileged) user that will"
1>&2
echo
"own the server process."
1>&2
exit
1
exit
1
fi
fi
...
@@ -52,7 +53,7 @@ do
...
@@ -52,7 +53,7 @@ do
-
*
)
-
*
)
echo
"
$CMDNAME
: invalid option:
$1
"
1>&2
echo
"
$CMDNAME
: invalid option:
$1
"
1>&2
echo
"Try
'
$CMDNAME
--help'
for more information."
1>&2
echo
"Try
\"
$CMDNAME
--help
\"
for more information."
1>&2
exit
1
exit
1
;;
;;
*
)
*
)
...
@@ -79,7 +80,7 @@ fi
...
@@ -79,7 +80,7 @@ fi
if
[
-z
"
$Location
"
]
;
then
if
[
-z
"
$Location
"
]
;
then
echo
"
$CMDNAME
: missing required argument LOCATION"
1>&2
echo
"
$CMDNAME
: missing required argument LOCATION"
1>&2
echo
"Try
'
$CMDNAME
-?' for help
."
1>&2
echo
"Try
\"
$CMDNAME
--help
\"
for more information
."
1>&2
exit
1
exit
1
fi
fi
...
@@ -112,8 +113,8 @@ else
...
@@ -112,8 +113,8 @@ else
haveenv
=
f
haveenv
=
f
fi
fi
echo
"The
location will be initialized with username
\"
$EffectiveUser
\"
."
echo
"The
files belonging to this location will be owned by user
\"
$EffectiveUser
\"
."
echo
"This user
will own all the files and
must also own the server process."
echo
"This user must also own the server process."
echo
echo
# -----------------------------------------------------------------------
# -----------------------------------------------------------------------
...
@@ -127,29 +128,29 @@ trap 'echo "Caught signal." ; exit_nicely' 1 2 3 15
...
@@ -127,29 +128,29 @@ trap 'echo "Caught signal." ; exit_nicely' 1 2 3 15
umask
077
umask
077
if
[
!
-d
"
$PGALTDATA
"
]
;
then
if
[
!
-d
"
$PGALTDATA
"
]
;
then
echo
"
C
reating directory
$PGALTDATA
"
echo
"
c
reating directory
$PGALTDATA
"
mkdir
"
$PGALTDATA
"
mkdir
"
$PGALTDATA
"
if
[
"
$?
"
-ne
0
]
;
then
if
[
"
$?
"
-ne
0
]
;
then
echo
"
$CMDNAME
: could not create
$PGALTDATA
"
1>&2
echo
"
$CMDNAME
: could not create
directory
\"
$PGALTDATA
\"
"
1>&2
echo
"Make sure
$PGALTDATA
is a valid path and that you have permission to access it."
1>&2
echo
"Make sure
\"
$PGALTDATA
\"
is a valid path and that you have permission to access it."
1>&2
exit_nicely
exit_nicely
fi
fi
else
else
echo
"
F
ixing permissions on pre-existing directory
$PGALTDATA
"
echo
"
f
ixing permissions on pre-existing directory
$PGALTDATA
"
chmod
go-rwx
"
$PGALTDATA
"
||
exit_nicely
chmod
go-rwx
"
$PGALTDATA
"
||
exit_nicely
fi
fi
if
[
!
-d
"
$PGALTDATA
"
/base
]
;
then
if
[
!
-d
"
$PGALTDATA
"
/base
]
;
then
echo
"
C
reating directory
$PGALTDATA
/base"
echo
"
c
reating directory
$PGALTDATA
/base"
mkdir
"
$PGALTDATA
/base"
mkdir
"
$PGALTDATA
/base"
if
[
"
$?
"
-ne
0
]
;
then
if
[
"
$?
"
-ne
0
]
;
then
echo
"
$CMDNAME
: could not create
$PGALTDATA
/base"
1>&2
echo
"
$CMDNAME
: could not create
$PGALTDATA
/base"
1>&2
echo
"Make sure
$PGALTDATA
/base
is a valid path and that you have permission to access it."
1>&2
echo
"Make sure
\"
$PGALTDATA
/base
\"
is a valid path and that you have permission to access it."
1>&2
exit_nicely
exit_nicely
fi
fi
else
else
echo
"
F
ixing permissions on pre-existing directory
$PGALTDATA
/base"
echo
"
f
ixing permissions on pre-existing directory
$PGALTDATA
/base"
chmod
go-rwx
"
$PGALTDATA
/base"
||
exit_nicely
chmod
go-rwx
"
$PGALTDATA
/base"
||
exit_nicely
fi
fi
...
...
src/bin/ipcclean/ipcclean.sh
View file @
c154fc3a
#!/bin/sh
#!/bin/sh
#
#
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.1
3 2002/10/18 22:05:35
petere Exp $
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.1
4 2003/07/23 08:47:23
petere Exp $
#
#
CMDNAME
=
`
basename
$0
`
CMDNAME
=
`
basename
$0
`
...
@@ -22,8 +22,9 @@ fi
...
@@ -22,8 +22,9 @@ fi
if
[
"
$USER
"
=
'root'
-o
"
$LOGNAME
"
=
'root'
]
if
[
"
$USER
"
=
'root'
-o
"
$LOGNAME
"
=
'root'
]
then
then
(
(
echo
"You cannot run
$CMDNAME
as root. Please log in (using, e.g., 'su')"
echo
"
$CMDNAME
: cannot be run as root"
1>&2
echo
"as the (unprivileged) user that owned the server process."
echo
"Please log in (using, e.g.,
\"
su
\"
) as the (unprivileged) user that"
1>&2
echo
"owned the server process."
1>&2
)
1>&2
)
1>&2
exit
1
exit
1
fi
fi
...
@@ -39,7 +40,7 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
...
@@ -39,7 +40,7 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
#
#
if
[
`
uname
`
=
'QNX'
]
;
then
if
[
`
uname
`
=
'QNX'
]
;
then
if
ps
-eA
|
grep
-s
'[p]ostmaster'
>
/dev/null 2>&1
;
then
if
ps
-eA
|
grep
-s
'[p]ostmaster'
>
/dev/null 2>&1
;
then
echo
"
$CMDNAME
:
You still have a postmaster running.
"
1>&2
echo
"
$CMDNAME
:
a postmaster is still running
"
1>&2
exit
1
exit
1
fi
fi
rm
-f
/dev/shmem/PgS
*
rm
-f
/dev/shmem/PgS
*
...
@@ -52,7 +53,7 @@ if [ `uname` = 'Linux' ]; then
...
@@ -52,7 +53,7 @@ if [ `uname` = 'Linux' ]; then
did_anything
=
did_anything
=
if
ps x |
grep
-s
'[p]ostmaster'
>
/dev/null 2>&1
;
then
if
ps x |
grep
-s
'[p]ostmaster'
>
/dev/null 2>&1
;
then
echo
"
$CMDNAME
:
You still have a postmaster running.
"
1>&2
echo
"
$CMDNAME
:
a postmaster is still running
"
1>&2
exit
1
exit
1
fi
fi
...
...
src/bin/pg_config/pg_config.sh
View file @
c154fc3a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
# Author: Peter Eisentraut <peter_e@gmx.net>
# Author: Peter Eisentraut <peter_e@gmx.net>
# Public domain
# Public domain
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.
7 2002/10/18 22:05:3
5 petere Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.
8 2003/07/23 08:47:2
5 petere Exp $
me
=
`
basename
$0
`
me
=
`
basename
$0
`
...
@@ -41,7 +41,7 @@ Options:
...
@@ -41,7 +41,7 @@ Options:
Report bugs to <pgsql-bugs@postgresql.org>."
Report bugs to <pgsql-bugs@postgresql.org>."
advice
=
"
\
advice
=
"
\
Try
'
$me
--help'
for more information."
Try
\"
$me
--help
\"
for more information."
if
test
"$#"
-eq
0
;
then
if
test
"$#"
-eq
0
;
then
echo
"
$me
: argument required"
1>&2
echo
"
$me
: argument required"
1>&2
...
...
src/bin/pg_controldata/pg_controldata.c
View file @
c154fc3a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
* licence: BSD
* licence: BSD
*
*
* $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.
9 2003/04/04 20:42:12 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.
10 2003/07/23 08:47:25 petere
Exp $
*/
*/
#include "postgres.h"
#include "postgres.h"
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
static
void
static
void
usage
(
const
char
*
progname
)
usage
(
const
char
*
progname
)
{
{
printf
(
_
(
"%s displays control information of a PostgreSQL database cluster.
\n\n
"
),
progname
);
printf
printf
(
(
_
(
_
(
...
@@ -32,13 +33,12 @@ usage(const char *progname)
...
@@ -32,13 +33,12 @@ usage(const char *progname)
" %s [OPTION]
\n\n
"
" %s [OPTION]
\n\n
"
"Options:
\n
"
"Options:
\n
"
" DATADIR show cluster control information for DATADIR
\n
"
" DATADIR show cluster control information for DATADIR
\n
"
" -
?, --help display this help and
exit
\n
"
" -
-help show this help, then
exit
\n
"
" -
V, --version display pg_controldata's version and exit
\n
\n
"
" -
-version output version information, then exit
\n
"
),
),
progname
progname
);
);
printf
(
_
(
"%s displays PostgreSQL database cluster control information.
\n
"
),
progname
);
printf
(
_
(
"
\n
If no data directory is specified, the environment variable PGDATA
\n
is used.
\n\n
"
));
printf
(
_
(
"If no data directory is specified, the environment variable PGDATA
\n
is used.
\n\n
"
));
printf
(
_
(
"Report bugs to <pgsql-bugs@postgresql.org>.
\n
"
));
printf
(
_
(
"Report bugs to <pgsql-bugs@postgresql.org>.
\n
"
));
}
}
...
@@ -105,7 +105,7 @@ main(int argc, char *argv[])
...
@@ -105,7 +105,7 @@ main(int argc, char *argv[])
if
(
DataDir
==
NULL
)
if
(
DataDir
==
NULL
)
{
{
fprintf
(
stderr
,
_
(
"%s: no data directory specified
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: no data directory specified
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -113,14 +113,14 @@ main(int argc, char *argv[])
...
@@ -113,14 +113,14 @@ main(int argc, char *argv[])
if
((
fd
=
open
(
ControlFilePath
,
O_RDONLY
))
==
-
1
)
if
((
fd
=
open
(
ControlFilePath
,
O_RDONLY
))
==
-
1
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not open file
\"
%s
\"
for reading
(%s)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not open file
\"
%s
\"
for reading
: %s
\n
"
),
progname
,
ControlFilePath
,
strerror
(
errno
));
progname
,
ControlFilePath
,
strerror
(
errno
));
exit
(
2
);
exit
(
2
);
}
}
if
(
read
(
fd
,
&
ControlFile
,
sizeof
(
ControlFileData
))
!=
sizeof
(
ControlFileData
))
if
(
read
(
fd
,
&
ControlFile
,
sizeof
(
ControlFileData
))
!=
sizeof
(
ControlFileData
))
{
{
fprintf
(
stderr
,
_
(
"%s: could not read file
\"
%s
\"
(%s)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not read file
\"
%s
\"
: %s
\n
"
),
progname
,
ControlFilePath
,
strerror
(
errno
));
progname
,
ControlFilePath
,
strerror
(
errno
));
exit
(
2
);
exit
(
2
);
}
}
...
@@ -170,7 +170,7 @@ main(int argc, char *argv[])
...
@@ -170,7 +170,7 @@ main(int argc, char *argv[])
printf
(
_
(
"Maximum length of identifiers: %u
\n
"
),
ControlFile
.
nameDataLen
);
printf
(
_
(
"Maximum length of identifiers: %u
\n
"
),
ControlFile
.
nameDataLen
);
printf
(
_
(
"Maximum number of function arguments: %u
\n
"
),
ControlFile
.
funcMaxArgs
);
printf
(
_
(
"Maximum number of function arguments: %u
\n
"
),
ControlFile
.
funcMaxArgs
);
printf
(
_
(
"Date/time type storage: %s
\n
"
),
printf
(
_
(
"Date/time type storage: %s
\n
"
),
(
ControlFile
.
enableIntTimes
?
_
(
"64-bit integers"
)
:
_
(
"
Floating point
"
)));
(
ControlFile
.
enableIntTimes
?
_
(
"64-bit integers"
)
:
_
(
"
floating-point numbers
"
)));
printf
(
_
(
"Maximum length of locale name: %u
\n
"
),
ControlFile
.
localeBuflen
);
printf
(
_
(
"Maximum length of locale name: %u
\n
"
),
ControlFile
.
localeBuflen
);
printf
(
_
(
"LC_COLLATE: %s
\n
"
),
ControlFile
.
lc_collate
);
printf
(
_
(
"LC_COLLATE: %s
\n
"
),
ControlFile
.
lc_collate
);
printf
(
_
(
"LC_CTYPE: %s
\n
"
),
ControlFile
.
lc_ctype
);
printf
(
_
(
"LC_CTYPE: %s
\n
"
),
ControlFile
.
lc_ctype
);
...
...
src/bin/pg_ctl/pg_ctl.sh
View file @
c154fc3a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.3
2 2003/03/20 05:00:14 momjian
Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.3
3 2003/07/23 08:47:30 petere
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -54,7 +54,7 @@ Shutdown modes are:
...
@@ -54,7 +54,7 @@ Shutdown modes are:
Report bugs to <pgsql-bugs@postgresql.org>."
Report bugs to <pgsql-bugs@postgresql.org>."
advice
=
"
\
advice
=
"
\
Try
'
$CMDNAME
--help'
for more information."
Try
\"
$CMDNAME
--help
\"
for more information."
# Placed here during build
# Placed here during build
...
@@ -103,8 +103,8 @@ if [ -x "$self_path/postmaster" ] && [ -x "$self_path/psql" ]; then
...
@@ -103,8 +103,8 @@ if [ -x "$self_path/postmaster" ] && [ -x "$self_path/psql" ]; then
elif
[
-x
"
$bindir
/postmaster"
]
&&
[
-x
"
$bindir
/psql"
]
;
then
elif
[
-x
"
$bindir
/postmaster"
]
&&
[
-x
"
$bindir
/psql"
]
;
then
PGPATH
=
"
$bindir
"
PGPATH
=
"
$bindir
"
else
else
echo
"The programs
'postmaster' and 'psql'
are needed by
$CMDNAME
but"
1>&2
echo
"The programs
\"
postmaster
\"
and
\"
psql
\"
are needed by
$CMDNAME
but"
1>&2
echo
"were not found in the directory
'
$bindir
'
."
1>&2
echo
"were not found in the directory
\"
$bindir
\"
."
1>&2
echo
"Check your installation."
1>&2
echo
"Check your installation."
1>&2
exit
1
exit
1
fi
fi
...
@@ -202,7 +202,7 @@ if [ x"$op" = x"" ];then
...
@@ -202,7 +202,7 @@ if [ x"$op" = x"" ];then
fi
fi
if
[
-z
"
$PGDATA
"
]
;
then
if
[
-z
"
$PGDATA
"
]
;
then
echo
"
$CMDNAME
: no database directory
or environment variable
\$
PGDATA is specified
"
1>&2
echo
"
$CMDNAME
: no database directory
specified and environment variable PGDATA unset
"
1>&2
echo
"
$advice
"
1>&2
echo
"
$advice
"
1>&2
exit
1
exit
1
fi
fi
...
@@ -248,15 +248,15 @@ if [ "$op" = "status" ];then
...
@@ -248,15 +248,15 @@ if [ "$op" = "status" ];then
PID
=
`
sed
-n
1p
$PIDFILE
`
PID
=
`
sed
-n
1p
$PIDFILE
`
if
[
"
$PID
"
-lt
0
]
;
then
if
[
"
$PID
"
-lt
0
]
;
then
PID
=
`
expr
0 -
$PID
`
PID
=
`
expr
0 -
$PID
`
echo
"
$CMDNAME
: postgres is running (
pid
:
$PID
)"
echo
"
$CMDNAME
: postgres is running (
PID
:
$PID
)"
else
else
echo
"
$CMDNAME
: postmaster is running (
pid
:
$PID
)"
echo
"
$CMDNAME
: postmaster is running (
PID
:
$PID
)"
echo
"Command line was:"
echo
"Command line was:"
cat
"
$POSTOPTSFILE
"
cat
"
$POSTOPTSFILE
"
fi
fi
exit
0
exit
0
else
else
echo
"
$CMDNAME
: postmaster or postgres
is
not running"
echo
"
$CMDNAME
: postmaster or postgres not running"
exit
1
exit
1
fi
fi
fi
fi
...
@@ -266,7 +266,7 @@ if [ "$op" = "stop" -o "$op" = "restart" -o "$op" = "reload" ];then
...
@@ -266,7 +266,7 @@ if [ "$op" = "stop" -o "$op" = "restart" -o "$op" = "reload" ];then
PID
=
`
sed
-n
1p
$PIDFILE
`
PID
=
`
sed
-n
1p
$PIDFILE
`
if
[
"
$PID
"
-lt
0
]
;
then
if
[
"
$PID
"
-lt
0
]
;
then
PID
=
`
expr
0 -
$PID
`
PID
=
`
expr
0 -
$PID
`
echo
"
$CMDNAME
:
Cannot restart postmaster. postgres is running (pid
:
$PID
)"
1>&2
echo
"
$CMDNAME
:
cannot restart postmaster; postgres is running (PID
:
$PID
)"
1>&2
echo
"Please terminate postgres and try again."
1>&2
echo
"Please terminate postgres and try again."
1>&2
exit
1
exit
1
fi
fi
...
...
src/bin/pg_dump/common.c
View file @
c154fc3a
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.7
2 2002/10/25 01:33:17 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.7
3 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -71,7 +71,7 @@ dumpSchema(Archive *fout,
...
@@ -71,7 +71,7 @@ dumpSchema(Archive *fout,
OpclassInfo
*
opcinfo
;
OpclassInfo
*
opcinfo
;
if
(
g_verbose
)
if
(
g_verbose
)
write_msg
(
NULL
,
"reading
namespace
s
\n
"
);
write_msg
(
NULL
,
"reading
schema
s
\n
"
);
nsinfo
=
getNamespaces
(
&
numNamespaces
);
nsinfo
=
getNamespaces
(
&
numNamespaces
);
if
(
g_verbose
)
if
(
g_verbose
)
...
@@ -125,7 +125,7 @@ dumpSchema(Archive *fout,
...
@@ -125,7 +125,7 @@ dumpSchema(Archive *fout,
if
(
!
dataOnly
)
if
(
!
dataOnly
)
{
{
if
(
g_verbose
)
if
(
g_verbose
)
write_msg
(
NULL
,
"dumping out user-defined
namespace
s
\n
"
);
write_msg
(
NULL
,
"dumping out user-defined
schema
s
\n
"
);
dumpNamespaces
(
fout
,
nsinfo
,
numNamespaces
);
dumpNamespaces
(
fout
,
nsinfo
,
numNamespaces
);
}
}
...
@@ -449,7 +449,7 @@ findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid)
...
@@ -449,7 +449,7 @@ findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid)
}
}
/* should never get here */
/* should never get here */
write_msg
(
NULL
,
"failed sanity check, operator with
oid
%s not found
\n
"
,
oid
);
write_msg
(
NULL
,
"failed sanity check, operator with
OID
%s not found
\n
"
,
oid
);
/* no suitable operator name was found */
/* no suitable operator name was found */
return
(
NULL
);
return
(
NULL
);
...
@@ -499,12 +499,12 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
...
@@ -499,12 +499,12 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
{
{
selfInd
=
findTableByOid
(
tblinfo
,
numTables
,
oid
);
selfInd
=
findTableByOid
(
tblinfo
,
numTables
,
oid
);
if
(
selfInd
>=
0
)
if
(
selfInd
>=
0
)
write_msg
(
NULL
,
"failed sanity check, parent
oid %s of table %s (oid
%s) not found
\n
"
,
write_msg
(
NULL
,
"failed sanity check, parent
OID %s of table
\"
%s
\"
(OID
%s) not found
\n
"
,
inhinfo
[
i
].
inhparent
,
inhinfo
[
i
].
inhparent
,
tblinfo
[
selfInd
].
relname
,
tblinfo
[
selfInd
].
relname
,
oid
);
oid
);
else
else
write_msg
(
NULL
,
"failed sanity check, parent
oid %s of table (oid
%s) not found
\n
"
,
write_msg
(
NULL
,
"failed sanity check, parent
OID %s of table (OID
%s) not found
\n
"
,
inhinfo
[
i
].
inhparent
,
inhinfo
[
i
].
inhparent
,
oid
);
oid
);
...
@@ -542,7 +542,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
...
@@ -542,7 +542,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
{
{
if
(
argNum
>=
arraysize
)
if
(
argNum
>=
arraysize
)
{
{
write_msg
(
NULL
,
"
parseNumericA
rray: too many numbers
\n
"
);
write_msg
(
NULL
,
"
could not parse numeric a
rray: too many numbers
\n
"
);
exit_nicely
();
exit_nicely
();
}
}
temp
[
j
]
=
'\0'
;
temp
[
j
]
=
'\0'
;
...
@@ -557,7 +557,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
...
@@ -557,7 +557,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
if
(
!
(
isdigit
((
unsigned
char
)
s
)
||
s
==
'-'
)
||
if
(
!
(
isdigit
((
unsigned
char
)
s
)
||
s
==
'-'
)
||
j
>=
sizeof
(
temp
)
-
1
)
j
>=
sizeof
(
temp
)
-
1
)
{
{
write_msg
(
NULL
,
"
parseNumericArray: bogus
number
\n
"
);
write_msg
(
NULL
,
"
could not parse numeric array: invalid character in
number
\n
"
);
exit_nicely
();
exit_nicely
();
}
}
temp
[
j
++
]
=
s
;
temp
[
j
++
]
=
s
;
...
...
src/bin/pg_dump/pg_backup_archiver.c
View file @
c154fc3a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.7
2 2003/05/14 03:26:02 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.7
3 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -119,7 +119,7 @@ CloseArchive(Archive *AHX)
...
@@ -119,7 +119,7 @@ CloseArchive(Archive *AHX)
res
=
fclose
(
AH
->
OF
);
res
=
fclose
(
AH
->
OF
);
if
(
res
!=
0
)
if
(
res
!=
0
)
die_horribly
(
AH
,
modulename
,
"could not close
the output file in CloseArchiv
e
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not close
output archive fil
e
\n
"
);
}
}
/* Public */
/* Public */
...
@@ -259,7 +259,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
...
@@ -259,7 +259,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
/* If we created a DB, connect to it... */
/* If we created a DB, connect to it... */
if
(
strcmp
(
te
->
desc
,
"DATABASE"
)
==
0
)
if
(
strcmp
(
te
->
desc
,
"DATABASE"
)
==
0
)
{
{
ahlog
(
AH
,
1
,
"connecting to new database
%s as user %s
\n
"
,
te
->
tag
,
te
->
owner
);
ahlog
(
AH
,
1
,
"connecting to new database
\"
%s
\"
as user
\"
%s
\"
\n
"
,
te
->
tag
,
te
->
owner
);
_reconnectAsUser
(
AH
,
te
->
tag
,
te
->
owner
);
_reconnectAsUser
(
AH
,
te
->
tag
,
te
->
owner
);
}
}
}
}
...
@@ -284,7 +284,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
...
@@ -284,7 +284,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
{
{
#ifndef HAVE_LIBZ
#ifndef HAVE_LIBZ
if
(
AH
->
compression
!=
0
)
if
(
AH
->
compression
!=
0
)
die_horribly
(
AH
,
modulename
,
"
unable to
restore from compressed archive (not configured for compression support)
\n
"
);
die_horribly
(
AH
,
modulename
,
"
cannot
restore from compressed archive (not configured for compression support)
\n
"
);
#endif
#endif
_printTocEntry
(
AH
,
te
,
ropt
,
true
);
_printTocEntry
(
AH
,
te
,
ropt
,
true
);
...
@@ -304,7 +304,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
...
@@ -304,7 +304,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
* we don't want warnings.
* we don't want warnings.
*/
*/
if
(
!
AH
->
CustomOutPtr
)
if
(
!
AH
->
CustomOutPtr
)
write_msg
(
modulename
,
"WARNING: skipping large
object restoration
\n
"
);
write_msg
(
modulename
,
"WARNING: skipping large
-
object restoration
\n
"
);
}
}
else
else
{
{
...
@@ -317,7 +317,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
...
@@ -317,7 +317,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
_reconnectAsOwner
(
AH
,
NULL
,
te
);
_reconnectAsOwner
(
AH
,
NULL
,
te
);
_selectOutputSchema
(
AH
,
te
->
namespace
);
_selectOutputSchema
(
AH
,
te
->
namespace
);
ahlog
(
AH
,
1
,
"restoring data for table
%s
\n
"
,
te
->
tag
);
ahlog
(
AH
,
1
,
"restoring data for table
\"
%s
\"
\n
"
,
te
->
tag
);
/*
/*
* If we have a copy statement, use it. As of
* If we have a copy statement, use it. As of
...
@@ -364,18 +364,18 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
...
@@ -364,18 +364,18 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
/* Is it table data? */
/* Is it table data? */
if
(
strcmp
(
te
->
desc
,
"TABLE DATA"
)
==
0
)
if
(
strcmp
(
te
->
desc
,
"TABLE DATA"
)
==
0
)
{
{
ahlog
(
AH
,
2
,
"checking whether we loaded
%s
\n
"
,
te
->
tag
);
ahlog
(
AH
,
2
,
"checking whether we loaded
\"
%s
\"
\n
"
,
te
->
tag
);
reqs
=
_tocEntryRequired
(
te
,
ropt
);
reqs
=
_tocEntryRequired
(
te
,
ropt
);
if
((
reqs
&
REQ_DATA
)
!=
0
)
/* We loaded the data */
if
((
reqs
&
REQ_DATA
)
!=
0
)
/* We loaded the data */
{
{
ahlog
(
AH
,
1
,
"fixing up large
object cross-reference for %s
\n
"
,
te
->
tag
);
ahlog
(
AH
,
1
,
"fixing up large
-object cross-reference for
\"
%s
\"
\n
"
,
te
->
tag
);
FixupBlobRefs
(
AH
,
te
);
FixupBlobRefs
(
AH
,
te
);
}
}
}
}
else
else
ahlog
(
AH
,
2
,
"ignoring large
object cross-references for %s %s
\n
"
,
te
->
desc
,
te
->
tag
);
ahlog
(
AH
,
2
,
"ignoring large
-
object cross-references for %s %s
\n
"
,
te
->
desc
,
te
->
tag
);
te
=
te
->
next
;
te
=
te
->
next
;
}
}
...
@@ -584,7 +584,7 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
...
@@ -584,7 +584,7 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
ArchiveHandle
*
AH
=
(
ArchiveHandle
*
)
AHX
;
ArchiveHandle
*
AH
=
(
ArchiveHandle
*
)
AHX
;
if
(
!
AH
->
currToc
)
if
(
!
AH
->
currToc
)
die_horribly
(
AH
,
modulename
,
"WriteData cannot be called outside the context of a DataDumper routine
\n
"
);
die_horribly
(
AH
,
modulename
,
"
internal error --
WriteData cannot be called outside the context of a DataDumper routine
\n
"
);
return
(
*
AH
->
WriteDataPtr
)
(
AH
,
data
,
dLen
);
return
(
*
AH
->
WriteDataPtr
)
(
AH
,
data
,
dLen
);
}
}
...
@@ -708,7 +708,7 @@ StartBlob(Archive *AHX, Oid oid)
...
@@ -708,7 +708,7 @@ StartBlob(Archive *AHX, Oid oid)
ArchiveHandle
*
AH
=
(
ArchiveHandle
*
)
AHX
;
ArchiveHandle
*
AH
=
(
ArchiveHandle
*
)
AHX
;
if
(
!
AH
->
StartBlobPtr
)
if
(
!
AH
->
StartBlobPtr
)
die_horribly
(
AH
,
modulename
,
"large
object output not supported in chosen format
\n
"
);
die_horribly
(
AH
,
modulename
,
"large
-
object output not supported in chosen format
\n
"
);
(
*
AH
->
StartBlobPtr
)
(
AH
,
AH
->
currToc
,
oid
);
(
*
AH
->
StartBlobPtr
)
(
AH
,
AH
->
currToc
,
oid
);
...
@@ -748,7 +748,7 @@ EndRestoreBlobs(ArchiveHandle *AH)
...
@@ -748,7 +748,7 @@ EndRestoreBlobs(ArchiveHandle *AH)
{
{
if
(
AH
->
txActive
)
if
(
AH
->
txActive
)
{
{
ahlog
(
AH
,
2
,
"committing large
object transactions
\n
"
);
ahlog
(
AH
,
2
,
"committing large
-
object transactions
\n
"
);
CommitTransaction
(
AH
);
CommitTransaction
(
AH
);
}
}
...
@@ -786,7 +786,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
...
@@ -786,7 +786,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
*/
*/
if
(
!
AH
->
txActive
)
if
(
!
AH
->
txActive
)
{
{
ahlog
(
AH
,
2
,
"starting large
object transactions
\n
"
);
ahlog
(
AH
,
2
,
"starting large
-
object transactions
\n
"
);
StartTransaction
(
AH
);
StartTransaction
(
AH
);
}
}
if
(
!
AH
->
blobTxActive
)
if
(
!
AH
->
blobTxActive
)
...
@@ -796,7 +796,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
...
@@ -796,7 +796,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
if
(
loOid
==
0
)
if
(
loOid
==
0
)
die_horribly
(
AH
,
modulename
,
"could not create large object
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not create large object
\n
"
);
ahlog
(
AH
,
2
,
"restoring large object with
oid
%u as %u
\n
"
,
oid
,
loOid
);
ahlog
(
AH
,
2
,
"restoring large object with
OID
%u as %u
\n
"
,
oid
,
loOid
);
InsertBlobXref
(
AH
,
oid
,
loOid
);
InsertBlobXref
(
AH
,
oid
,
loOid
);
...
@@ -817,7 +817,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
...
@@ -817,7 +817,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
res
=
lo_write
(
AH
->
connection
,
AH
->
loFd
,
(
void
*
)
AH
->
lo_buf
,
AH
->
lo_buf_used
);
res
=
lo_write
(
AH
->
connection
,
AH
->
loFd
,
(
void
*
)
AH
->
lo_buf
,
AH
->
lo_buf_used
);
ahlog
(
AH
,
5
,
"wrote remaining %lu bytes of large
object data (result = %lu)
\n
"
,
ahlog
(
AH
,
5
,
"wrote remaining %lu bytes of large
-
object data (result = %lu)
\n
"
,
(
unsigned
long
)
AH
->
lo_buf_used
,
(
unsigned
long
)
res
);
(
unsigned
long
)
AH
->
lo_buf_used
,
(
unsigned
long
)
res
);
if
(
res
!=
AH
->
lo_buf_used
)
if
(
res
!=
AH
->
lo_buf_used
)
die_horribly
(
AH
,
modulename
,
"could not write to large object (result: %lu, expected: %lu)
\n
"
,
die_horribly
(
AH
,
modulename
,
"could not write to large object (result: %lu, expected: %lu)
\n
"
,
...
@@ -833,7 +833,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
...
@@ -833,7 +833,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
*/
*/
if
(((
AH
->
blobCount
/
BLOB_BATCH_SIZE
)
*
BLOB_BATCH_SIZE
)
==
AH
->
blobCount
)
if
(((
AH
->
blobCount
/
BLOB_BATCH_SIZE
)
*
BLOB_BATCH_SIZE
)
==
AH
->
blobCount
)
{
{
ahlog
(
AH
,
2
,
"committing large
object transactions
\n
"
);
ahlog
(
AH
,
2
,
"committing large
-
object transactions
\n
"
);
CommitTransaction
(
AH
);
CommitTransaction
(
AH
);
CommitTransactionXref
(
AH
);
CommitTransactionXref
(
AH
);
}
}
...
@@ -985,7 +985,7 @@ SortTocFromFile(Archive *AHX, RestoreOptions *ropt)
...
@@ -985,7 +985,7 @@ SortTocFromFile(Archive *AHX, RestoreOptions *ropt)
/* Find TOC entry */
/* Find TOC entry */
te
=
_getTocEntry
(
AH
,
id
);
te
=
_getTocEntry
(
AH
,
id
);
if
(
!
te
)
if
(
!
te
)
die_horribly
(
AH
,
modulename
,
"could not find entry for
id
%d
\n
"
,
id
);
die_horribly
(
AH
,
modulename
,
"could not find entry for
ID
%d
\n
"
,
id
);
ropt
->
idWanted
[
id
-
1
]
=
1
;
ropt
->
idWanted
[
id
-
1
]
=
1
;
...
@@ -1775,7 +1775,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
...
@@ -1775,7 +1775,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
break
;
break
;
default:
default:
die_horribly
(
AH
,
modulename
,
"unrecognized file format
'%d'
\n
"
,
fmt
);
die_horribly
(
AH
,
modulename
,
"unrecognized file format
\"
%d
\"
\n
"
,
fmt
);
}
}
return
AH
;
return
AH
;
...
@@ -1888,7 +1888,7 @@ ReadToc(ArchiveHandle *AH)
...
@@ -1888,7 +1888,7 @@ ReadToc(ArchiveHandle *AH)
/* Sanity check */
/* Sanity check */
if
(
te
->
id
<=
0
||
te
->
id
>
AH
->
tocCount
)
if
(
te
->
id
<=
0
||
te
->
id
>
AH
->
tocCount
)
die_horribly
(
AH
,
modulename
,
"entry
id %d out of range
- perhaps a corrupt TOC
\n
"
,
te
->
id
);
die_horribly
(
AH
,
modulename
,
"entry
ID %d out of range -
- perhaps a corrupt TOC
\n
"
,
te
->
id
);
te
->
hadDumper
=
ReadInt
(
AH
);
te
->
hadDumper
=
ReadInt
(
AH
);
te
->
oid
=
ReadStr
(
AH
);
te
->
oid
=
ReadStr
(
AH
);
...
@@ -1945,7 +1945,7 @@ ReadToc(ArchiveHandle *AH)
...
@@ -1945,7 +1945,7 @@ ReadToc(ArchiveHandle *AH)
if
(
AH
->
ReadExtraTocPtr
)
if
(
AH
->
ReadExtraTocPtr
)
(
*
AH
->
ReadExtraTocPtr
)
(
AH
,
te
);
(
*
AH
->
ReadExtraTocPtr
)
(
AH
,
te
);
ahlog
(
AH
,
3
,
"read TOC entry %d (
id
%d) for %s %s
\n
"
,
i
,
te
->
id
,
te
->
desc
,
te
->
tag
);
ahlog
(
AH
,
3
,
"read TOC entry %d (
ID
%d) for %s %s
\n
"
,
i
,
te
->
id
,
te
->
desc
,
te
->
tag
);
te
->
prev
=
AH
->
toc
->
prev
;
te
->
prev
=
AH
->
toc
->
prev
;
AH
->
toc
->
prev
->
next
=
te
;
AH
->
toc
->
prev
->
next
=
te
;
...
@@ -2071,7 +2071,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
...
@@ -2071,7 +2071,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
res
=
PQexec
(
AH
->
connection
,
cmd
->
data
);
res
=
PQexec
(
AH
->
connection
,
cmd
->
data
);
if
(
!
res
||
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
if
(
!
res
||
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
die_horribly
(
AH
,
modulename
,
"could not set session user to
%s
: %s"
,
die_horribly
(
AH
,
modulename
,
"could not set session user to
\"
%s
\"
: %s"
,
user
,
PQerrorMessage
(
AH
->
connection
));
user
,
PQerrorMessage
(
AH
->
connection
));
PQclear
(
res
);
PQclear
(
res
);
...
@@ -2185,7 +2185,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName)
...
@@ -2185,7 +2185,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName)
res
=
PQexec
(
AH
->
connection
,
qry
->
data
);
res
=
PQexec
(
AH
->
connection
,
qry
->
data
);
if
(
!
res
||
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
if
(
!
res
||
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
die_horribly
(
AH
,
modulename
,
"could not set search_path to
%s
: %s"
,
die_horribly
(
AH
,
modulename
,
"could not set search_path to
\"
%s
\"
: %s"
,
schemaName
,
PQerrorMessage
(
AH
->
connection
));
schemaName
,
PQerrorMessage
(
AH
->
connection
));
PQclear
(
res
);
PQclear
(
res
);
...
@@ -2246,7 +2246,7 @@ WriteHead(ArchiveHandle *AH)
...
@@ -2246,7 +2246,7 @@ WriteHead(ArchiveHandle *AH)
#ifndef HAVE_LIBZ
#ifndef HAVE_LIBZ
if
(
AH
->
compression
!=
0
)
if
(
AH
->
compression
!=
0
)
write_msg
(
modulename
,
"WARNING: requested compression not available in this "
write_msg
(
modulename
,
"WARNING: requested compression not available in this "
"installation - archive will be uncompressed
\n
"
);
"installation -
-
archive will be uncompressed
\n
"
);
AH
->
compression
=
0
;
AH
->
compression
=
0
;
#endif
#endif
...
@@ -2327,7 +2327,7 @@ ReadHead(ArchiveHandle *AH)
...
@@ -2327,7 +2327,7 @@ ReadHead(ArchiveHandle *AH)
#ifndef HAVE_LIBZ
#ifndef HAVE_LIBZ
if
(
AH
->
compression
!=
0
)
if
(
AH
->
compression
!=
0
)
write_msg
(
modulename
,
"WARNING: archive is compressed, but this installation does not support compression - no data will be available
\n
"
);
write_msg
(
modulename
,
"WARNING: archive is compressed, but this installation does not support compression -
-
no data will be available
\n
"
);
#endif
#endif
if
(
AH
->
version
>=
K_VERS_1_4
)
if
(
AH
->
version
>=
K_VERS_1_4
)
...
...
src/bin/pg_dump/pg_backup_custom.c
View file @
c154fc3a
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
3 2002/10/25 01:33:17 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
4 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -177,7 +177,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
...
@@ -177,7 +177,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
AH
->
FH
=
stdout
;
AH
->
FH
=
stdout
;
if
(
!
AH
->
FH
)
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open archive file
%s
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"could not open archive file
\"
%s
\"
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
}
}
...
@@ -188,7 +188,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
...
@@ -188,7 +188,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
else
else
AH
->
FH
=
stdin
;
AH
->
FH
=
stdin
;
if
(
!
AH
->
FH
)
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open archive file
%s
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"could not open archive file
\"
%s
\"
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
...
@@ -444,7 +444,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -444,7 +444,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
if
((
TocIDRequired
(
AH
,
id
,
ropt
)
&
2
)
!=
0
)
if
((
TocIDRequired
(
AH
,
id
,
ropt
)
&
2
)
!=
0
)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"Dumping a specific TOC data block out of order is not supported"
"Dumping a specific TOC data block out of order is not supported"
" without
id
on this input stream (fseek required)
\n
"
);
" without
ID
on this input stream (fseek required)
\n
"
);
switch
(
blkType
)
switch
(
blkType
)
{
{
...
@@ -476,7 +476,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -476,7 +476,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
/* Are we sane? */
/* Are we sane? */
if
(
id
!=
te
->
id
)
if
(
id
!=
te
->
id
)
die_horribly
(
AH
,
modulename
,
"found unexpected block ID (%d) when reading data - expected %d
\n
"
,
die_horribly
(
AH
,
modulename
,
"found unexpected block ID (%d) when reading data -
-
expected %d
\n
"
,
id
,
te
->
id
);
id
,
te
->
id
);
switch
(
blkType
)
switch
(
blkType
)
...
@@ -551,7 +551,7 @@ _PrintData(ArchiveHandle *AH)
...
@@ -551,7 +551,7 @@ _PrintData(ArchiveHandle *AH)
cnt
=
fread
(
in
,
1
,
blkLen
,
AH
->
FH
);
cnt
=
fread
(
in
,
1
,
blkLen
,
AH
->
FH
);
if
(
cnt
!=
blkLen
)
if
(
cnt
!=
blkLen
)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"could not read data block - expected %lu, got %lu
\n
"
,
"could not read data block -
-
expected %lu, got %lu
\n
"
,
(
unsigned
long
)
blkLen
,
(
unsigned
long
)
cnt
);
(
unsigned
long
)
blkLen
,
(
unsigned
long
)
cnt
);
ctx
->
filePos
+=
blkLen
;
ctx
->
filePos
+=
blkLen
;
...
@@ -569,7 +569,7 @@ _PrintData(ArchiveHandle *AH)
...
@@ -569,7 +569,7 @@ _PrintData(ArchiveHandle *AH)
zp
->
avail_out
=
zlibOutSize
;
zp
->
avail_out
=
zlibOutSize
;
res
=
inflate
(
zp
,
0
);
res
=
inflate
(
zp
,
0
);
if
(
res
!=
Z_OK
&&
res
!=
Z_STREAM_END
)
if
(
res
!=
Z_OK
&&
res
!=
Z_STREAM_END
)
die_horribly
(
AH
,
modulename
,
"
unable to
uncompress data: %s
\n
"
,
zp
->
msg
);
die_horribly
(
AH
,
modulename
,
"
could not
uncompress data: %s
\n
"
,
zp
->
msg
);
out
[
zlibOutSize
-
zp
->
avail_out
]
=
'\0'
;
out
[
zlibOutSize
-
zp
->
avail_out
]
=
'\0'
;
ahwrite
(
out
,
1
,
zlibOutSize
-
zp
->
avail_out
,
AH
);
ahwrite
(
out
,
1
,
zlibOutSize
-
zp
->
avail_out
,
AH
);
...
@@ -599,7 +599,7 @@ _PrintData(ArchiveHandle *AH)
...
@@ -599,7 +599,7 @@ _PrintData(ArchiveHandle *AH)
zp
->
avail_out
=
zlibOutSize
;
zp
->
avail_out
=
zlibOutSize
;
res
=
inflate
(
zp
,
0
);
res
=
inflate
(
zp
,
0
);
if
(
res
!=
Z_OK
&&
res
!=
Z_STREAM_END
)
if
(
res
!=
Z_OK
&&
res
!=
Z_STREAM_END
)
die_horribly
(
AH
,
modulename
,
"
unable to
uncompress data: %s
\n
"
,
zp
->
msg
);
die_horribly
(
AH
,
modulename
,
"
could not
uncompress data: %s
\n
"
,
zp
->
msg
);
out
[
zlibOutSize
-
zp
->
avail_out
]
=
'\0'
;
out
[
zlibOutSize
-
zp
->
avail_out
]
=
'\0'
;
ahwrite
(
out
,
1
,
zlibOutSize
-
zp
->
avail_out
,
AH
);
ahwrite
(
out
,
1
,
zlibOutSize
-
zp
->
avail_out
,
AH
);
...
@@ -674,7 +674,7 @@ _skipData(ArchiveHandle *AH)
...
@@ -674,7 +674,7 @@ _skipData(ArchiveHandle *AH)
cnt
=
fread
(
in
,
1
,
blkLen
,
AH
->
FH
);
cnt
=
fread
(
in
,
1
,
blkLen
,
AH
->
FH
);
if
(
cnt
!=
blkLen
)
if
(
cnt
!=
blkLen
)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"could not read data block - expected %lu, got %lu
\n
"
,
"could not read data block -
-
expected %lu, got %lu
\n
"
,
(
unsigned
long
)
blkLen
,
(
unsigned
long
)
cnt
);
(
unsigned
long
)
blkLen
,
(
unsigned
long
)
cnt
);
ctx
->
filePos
+=
blkLen
;
ctx
->
filePos
+=
blkLen
;
...
...
src/bin/pg_dump/pg_backup_db.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
* Implements the basic DB functions used by the archiver.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.4
8 2003/06/22 00:56:58 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.4
9 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -45,7 +45,7 @@ _parse_version(ArchiveHandle *AH, const char *versionString)
...
@@ -45,7 +45,7 @@ _parse_version(ArchiveHandle *AH, const char *versionString)
v
=
parse_version
(
versionString
);
v
=
parse_version
(
versionString
);
if
(
v
<
0
)
if
(
v
<
0
)
die_horribly
(
AH
,
modulename
,
"
unable to
parse version string
\"
%s
\"\n
"
,
versionString
);
die_horribly
(
AH
,
modulename
,
"
could not
parse version string
\"
%s
\"\n
"
,
versionString
);
return
v
;
return
v
;
}
}
...
@@ -148,7 +148,7 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
...
@@ -148,7 +148,7 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
else
else
newuser
=
(
char
*
)
requser
;
newuser
=
(
char
*
)
requser
;
ahlog
(
AH
,
1
,
"connecting to database
%s as user %s
\n
"
,
newdb
,
newuser
);
ahlog
(
AH
,
1
,
"connecting to database
\"
%s
\"
as user
\"
%s
\"
\n
"
,
newdb
,
newuser
);
if
(
AH
->
requirePassword
)
if
(
AH
->
requirePassword
)
{
{
...
@@ -585,7 +585,7 @@ FixupBlobRefs(ArchiveHandle *AH, TocEntry *te)
...
@@ -585,7 +585,7 @@ FixupBlobRefs(ArchiveHandle *AH, TocEntry *te)
res
=
PQexec
(
AH
->
blobConnection
,
tblQry
->
data
);
res
=
PQexec
(
AH
->
blobConnection
,
tblQry
->
data
);
if
(
!
res
)
if
(
!
res
)
die_horribly
(
AH
,
modulename
,
"could not find
oid
columns of table
\"
%s
\"
: %s"
,
die_horribly
(
AH
,
modulename
,
"could not find
OID
columns of table
\"
%s
\"
: %s"
,
te
->
tag
,
PQerrorMessage
(
AH
->
connection
));
te
->
tag
,
PQerrorMessage
(
AH
->
connection
));
if
((
n
=
PQntuples
(
res
))
==
0
)
if
((
n
=
PQntuples
(
res
))
==
0
)
...
...
src/bin/pg_dump/pg_backup_tar.c
View file @
c154fc3a
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
5 2003/03/20 03:34:56 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
6 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -374,7 +374,7 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
...
@@ -374,7 +374,7 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
sprintf
(
fmode
,
"wb%d"
,
AH
->
compression
);
sprintf
(
fmode
,
"wb%d"
,
AH
->
compression
);
tm
->
zFH
=
gzdopen
(
dup
(
fileno
(
tm
->
tmpFH
)),
fmode
);
tm
->
zFH
=
gzdopen
(
dup
(
fileno
(
tm
->
tmpFH
)),
fmode
);
if
(
tm
->
zFH
==
NULL
)
if
(
tm
->
zFH
==
NULL
)
die_horribly
(
AH
,
modulename
,
"could not
gzd
open temporary file
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not open temporary file
\n
"
);
}
}
else
else
...
@@ -504,7 +504,7 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh)
...
@@ -504,7 +504,7 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh)
res
=
fread
(
&
((
char
*
)
buf
)[
used
],
1
,
len
,
th
->
nFH
);
res
=
fread
(
&
((
char
*
)
buf
)[
used
],
1
,
len
,
th
->
nFH
);
}
}
else
else
die_horribly
(
AH
,
modulename
,
"
neither th nor fh specified in tarReadRaw() (internal error
)
\n
"
);
die_horribly
(
AH
,
modulename
,
"
internal error -- neither th nor fh specified in tarReadRaw(
)
\n
"
);
}
}
#if 0
#if 0
...
@@ -636,7 +636,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -636,7 +636,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
*/
*/
if
(
strncmp
(
tmpCopy
,
"copy "
,
5
)
!=
0
)
if
(
strncmp
(
tmpCopy
,
"copy "
,
5
)
!=
0
)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"
bad COPY statement
- could not find
\"
copy
\"
in string
\"
%s
\"\n
"
,
tmpCopy
);
"
invalid COPY statement -
- could not find
\"
copy
\"
in string
\"
%s
\"\n
"
,
tmpCopy
);
pos1
=
5
;
pos1
=
5
;
for
(
pos1
=
5
;
pos1
<
strlen
(
tmpCopy
);
pos1
++
)
for
(
pos1
=
5
;
pos1
<
strlen
(
tmpCopy
);
pos1
++
)
...
@@ -654,7 +654,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -654,7 +654,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
if
(
pos2
>=
strlen
(
tmpCopy
))
if
(
pos2
>=
strlen
(
tmpCopy
))
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"
bad COPY statement
- could not find
\"
from stdin
\"
in string
\"
%s
\"
starting at position %lu
\n
"
,
"
invalid COPY statement -
- could not find
\"
from stdin
\"
in string
\"
%s
\"
starting at position %lu
\n
"
,
tmpCopy
,
(
unsigned
long
)
pos1
);
tmpCopy
,
(
unsigned
long
)
pos1
);
ahwrite
(
tmpCopy
,
1
,
pos2
,
AH
);
/* 'copy "table" [with oids]' */
ahwrite
(
tmpCopy
,
1
,
pos2
,
AH
);
/* 'copy "table" [with oids]' */
...
@@ -1316,6 +1316,6 @@ _tarWriteHeader(TAR_MEMBER *th)
...
@@ -1316,6 +1316,6 @@ _tarWriteHeader(TAR_MEMBER *th)
}
}
if
(
fwrite
(
h
,
1
,
512
,
th
->
tarFH
)
!=
512
)
if
(
fwrite
(
h
,
1
,
512
,
th
->
tarFH
)
!=
512
)
die_horribly
(
th
->
AH
,
modulename
,
"
unable to
write tar header
\n
"
);
die_horribly
(
th
->
AH
,
modulename
,
"
could not
write tar header
\n
"
);
}
}
src/bin/pg_dump/pg_dump.c
View file @
c154fc3a
This diff is collapsed.
Click to expand it.
src/bin/pg_dump/pg_dumpall.c
View file @
c154fc3a
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
*
*
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.2
2 2003/06/22 00:56:58 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.2
3 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -189,17 +189,17 @@ main(int argc, char *argv[])
...
@@ -189,17 +189,17 @@ main(int argc, char *argv[])
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
if
(
optind
<
argc
)
if
(
optind
<
argc
)
{
{
fprintf
(
stderr
,
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
_
(
"%s: too many command line options (first is '%s')
\n
"
progname
,
argv
[
optind
]);
"Try '%s --help'
for more information.
\n
"
),
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
,
argv
[
optind
],
progname
);
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -494,7 +494,7 @@ dumpCreateDB(PGconn *conn)
...
@@ -494,7 +494,7 @@ dumpCreateDB(PGconn *conn)
!
buildACLCommands
(
fdbname
,
"DATABASE"
,
dbacl
,
dbowner
,
!
buildACLCommands
(
fdbname
,
"DATABASE"
,
dbacl
,
dbowner
,
server_version
,
buf
))
server_version
,
buf
))
{
{
fprintf
(
stderr
,
_
(
"%s: could not parse ACL list (%s) for database
%s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not parse ACL list (%s) for database
\"
%s
\"
\n
"
),
progname
,
dbacl
,
fdbname
);
progname
,
dbacl
,
fdbname
);
PQfinish
(
conn
);
PQfinish
(
conn
);
exit
(
1
);
exit
(
1
);
...
@@ -641,7 +641,7 @@ dumpDatabases(PGconn *conn)
...
@@ -641,7 +641,7 @@ dumpDatabases(PGconn *conn)
ret
=
runPgDump
(
dbname
);
ret
=
runPgDump
(
dbname
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
{
{
fprintf
(
stderr
,
_
(
"%s: pg_dump failed on
%s
, exiting
\n
"
),
progname
,
dbname
);
fprintf
(
stderr
,
_
(
"%s: pg_dump failed on
database
\"
%s
\"
, exiting
\n
"
),
progname
,
dbname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -676,7 +676,7 @@ runPgDump(const char *dbname)
...
@@ -676,7 +676,7 @@ runPgDump(const char *dbname)
appendPQExpBufferChar
(
cmd
,
'\''
);
appendPQExpBufferChar
(
cmd
,
'\''
);
if
(
verbose
)
if
(
verbose
)
fprintf
(
stderr
,
_
(
"%s: running
%s
\n
"
),
progname
,
cmd
->
data
);
fprintf
(
stderr
,
_
(
"%s: running
\"
%s
\"
\n
"
),
progname
,
cmd
->
data
);
fflush
(
stdout
);
fflush
(
stdout
);
fflush
(
stderr
);
fflush
(
stderr
);
...
@@ -717,7 +717,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
...
@@ -717,7 +717,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
if
(
!
conn
)
if
(
!
conn
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not connect to database
%s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not connect to database
\"
%s
\"
\n
"
),
progname
,
dbname
);
progname
,
dbname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -740,7 +740,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
...
@@ -740,7 +740,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
/* check to see that the backend connection was successfully made */
/* check to see that the backend connection was successfully made */
if
(
PQstatus
(
conn
)
==
CONNECTION_BAD
)
if
(
PQstatus
(
conn
)
==
CONNECTION_BAD
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not connect to database
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not connect to database
\"
%s
\"
: %s
\n
"
),
progname
,
dbname
,
PQerrorMessage
(
conn
));
progname
,
dbname
,
PQerrorMessage
(
conn
));
exit
(
1
);
exit
(
1
);
}
}
...
...
src/bin/pg_dump/pg_restore.c
View file @
c154fc3a
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.4
7 2003/06/11 16:29:42 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.4
8 2003/07/23 08:47:30 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -273,7 +273,7 @@ main(int argc, char **argv)
...
@@ -273,7 +273,7 @@ main(int argc, char **argv)
fprintf
(
stderr
,
fprintf
(
stderr
,
_
(
"%s: invalid -X option -- %s
\n
"
),
_
(
"%s: invalid -X option -- %s
\n
"
),
progname
,
optarg
);
progname
,
optarg
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
break
;
break
;
...
@@ -283,7 +283,7 @@ main(int argc, char **argv)
...
@@ -283,7 +283,7 @@ main(int argc, char **argv)
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
...
src/bin/pg_resetxlog/pg_resetxlog.c
View file @
c154fc3a
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.
9 2003/04/04 20:42:13 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.
10 2003/07/23 08:47:32 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -138,8 +138,8 @@ main(int argc, char *argv[])
...
@@ -138,8 +138,8 @@ main(int argc, char *argv[])
set_xid
=
strtoul
(
optarg
,
&
endptr
,
0
);
set_xid
=
strtoul
(
optarg
,
&
endptr
,
0
);
if
(
endptr
==
optarg
||
*
endptr
!=
'\0'
)
if
(
endptr
==
optarg
||
*
endptr
!=
'\0'
)
{
{
fprintf
(
stderr
,
_
(
"%s: invalid argument for
-x option
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: invalid argument for
option -x
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
if
(
set_xid
==
0
)
if
(
set_xid
==
0
)
...
@@ -153,8 +153,8 @@ main(int argc, char *argv[])
...
@@ -153,8 +153,8 @@ main(int argc, char *argv[])
set_oid
=
strtoul
(
optarg
,
&
endptr
,
0
);
set_oid
=
strtoul
(
optarg
,
&
endptr
,
0
);
if
(
endptr
==
optarg
||
*
endptr
!=
'\0'
)
if
(
endptr
==
optarg
||
*
endptr
!=
'\0'
)
{
{
fprintf
(
stderr
,
_
(
"%s: invalid argument for
-o option
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: invalid argument for
option -o
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
if
(
set_oid
==
0
)
if
(
set_oid
==
0
)
...
@@ -168,21 +168,21 @@ main(int argc, char *argv[])
...
@@ -168,21 +168,21 @@ main(int argc, char *argv[])
minXlogId
=
strtoul
(
optarg
,
&
endptr
,
0
);
minXlogId
=
strtoul
(
optarg
,
&
endptr
,
0
);
if
(
endptr
==
optarg
||
*
endptr
!=
','
)
if
(
endptr
==
optarg
||
*
endptr
!=
','
)
{
{
fprintf
(
stderr
,
_
(
"%s: invalid argument for
-l option
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: invalid argument for
option -l
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
minXlogSeg
=
strtoul
(
endptr
+
1
,
&
endptr2
,
0
);
minXlogSeg
=
strtoul
(
endptr
+
1
,
&
endptr2
,
0
);
if
(
endptr2
==
endptr
+
1
||
*
endptr2
!=
'\0'
)
if
(
endptr2
==
endptr
+
1
||
*
endptr2
!=
'\0'
)
{
{
fprintf
(
stderr
,
_
(
"%s: invalid argument for
-l option
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: invalid argument for
option -l
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -190,7 +190,7 @@ main(int argc, char *argv[])
...
@@ -190,7 +190,7 @@ main(int argc, char *argv[])
if
(
optind
==
argc
)
if
(
optind
==
argc
)
{
{
fprintf
(
stderr
,
_
(
"%s: no data directory specified
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: no data directory specified
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -209,14 +209,14 @@ main(int argc, char *argv[])
...
@@ -209,14 +209,14 @@ main(int argc, char *argv[])
{
{
if
(
errno
!=
ENOENT
)
if
(
errno
!=
ENOENT
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not open
%s
for reading: %s
\n
"
),
progname
,
path
,
strerror
(
errno
));
fprintf
(
stderr
,
_
(
"%s: could not open
file
\"
%s
\"
for reading: %s
\n
"
),
progname
,
path
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
}
}
else
else
{
{
fprintf
(
stderr
,
_
(
"%s: lock file
%s
exists
\n
"
fprintf
(
stderr
,
_
(
"%s: lock file
\"
%s
\"
exists
\n
"
"Is a server running? If not, delete the lock file and try again.
\n
"
),
"Is a server running?
If not, delete the lock file and try again.
\n
"
),
progname
,
path
);
progname
,
path
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -305,10 +305,10 @@ ReadControlFile(void)
...
@@ -305,10 +305,10 @@ ReadControlFile(void)
* odds are we've been handed a bad DataDir path, so give up. User
* odds are we've been handed a bad DataDir path, so give up. User
* can do "touch pg_control" to force us to proceed.
* can do "touch pg_control" to force us to proceed.
*/
*/
fprintf
(
stderr
,
_
(
"%s: could not open
%s
for reading: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not open
file
\"
%s
\"
for reading: %s
\n
"
),
progname
,
ControlFilePath
,
strerror
(
errno
));
progname
,
ControlFilePath
,
strerror
(
errno
));
if
(
errno
==
ENOENT
)
if
(
errno
==
ENOENT
)
fprintf
(
stderr
,
_
(
"If you are sure the data directory path is correct,
do
\n
"
fprintf
(
stderr
,
_
(
"If you are sure the data directory path is correct,
execute
\n
"
" touch %s
\n
"
" touch %s
\n
"
"and try again.
\n
"
),
"and try again.
\n
"
),
ControlFilePath
);
ControlFilePath
);
...
@@ -321,7 +321,7 @@ ReadControlFile(void)
...
@@ -321,7 +321,7 @@ ReadControlFile(void)
len
=
read
(
fd
,
buffer
,
BLCKSZ
);
len
=
read
(
fd
,
buffer
,
BLCKSZ
);
if
(
len
<
0
)
if
(
len
<
0
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not read
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not read
file
\"
%s
\"
: %s
\n
"
),
progname
,
ControlFilePath
,
strerror
(
errno
));
progname
,
ControlFilePath
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
@@ -449,7 +449,7 @@ PrintControlValues(bool guessed)
...
@@ -449,7 +449,7 @@ PrintControlValues(bool guessed)
printf
(
_
(
"Maximum length of identifiers: %u
\n
"
),
ControlFile
.
nameDataLen
);
printf
(
_
(
"Maximum length of identifiers: %u
\n
"
),
ControlFile
.
nameDataLen
);
printf
(
_
(
"Maximum number of function arguments: %u
\n
"
),
ControlFile
.
funcMaxArgs
);
printf
(
_
(
"Maximum number of function arguments: %u
\n
"
),
ControlFile
.
funcMaxArgs
);
printf
(
_
(
"Date/time type storage: %s
\n
"
),
printf
(
_
(
"Date/time type storage: %s
\n
"
),
(
ControlFile
.
enableIntTimes
?
_
(
"64-bit integers"
)
:
_
(
"
Floating point
"
)));
(
ControlFile
.
enableIntTimes
?
_
(
"64-bit integers"
)
:
_
(
"
floating-point numbers
"
)));
printf
(
_
(
"Maximum length of locale name: %u
\n
"
),
ControlFile
.
localeBuflen
);
printf
(
_
(
"Maximum length of locale name: %u
\n
"
),
ControlFile
.
localeBuflen
);
printf
(
_
(
"LC_COLLATE: %s
\n
"
),
ControlFile
.
lc_collate
);
printf
(
_
(
"LC_COLLATE: %s
\n
"
),
ControlFile
.
lc_collate
);
printf
(
_
(
"LC_CTYPE: %s
\n
"
),
ControlFile
.
lc_ctype
);
printf
(
_
(
"LC_CTYPE: %s
\n
"
),
ControlFile
.
lc_ctype
);
...
@@ -557,7 +557,7 @@ KillExistingXLOG(void)
...
@@ -557,7 +557,7 @@ KillExistingXLOG(void)
xldir
=
opendir
(
XLogDir
);
xldir
=
opendir
(
XLogDir
);
if
(
xldir
==
NULL
)
if
(
xldir
==
NULL
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not open directory
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not open directory
\"
%s
\"
: %s
\n
"
),
progname
,
XLogDir
,
strerror
(
errno
));
progname
,
XLogDir
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
@@ -571,7 +571,7 @@ KillExistingXLOG(void)
...
@@ -571,7 +571,7 @@ KillExistingXLOG(void)
snprintf
(
path
,
MAXPGPATH
,
"%s/%s"
,
XLogDir
,
xlde
->
d_name
);
snprintf
(
path
,
MAXPGPATH
,
"%s/%s"
,
XLogDir
,
xlde
->
d_name
);
if
(
unlink
(
path
)
<
0
)
if
(
unlink
(
path
)
<
0
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not delete file
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not delete file
\"
%s
\"
: %s
\n
"
),
progname
,
path
,
strerror
(
errno
));
progname
,
path
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
@@ -581,7 +581,7 @@ KillExistingXLOG(void)
...
@@ -581,7 +581,7 @@ KillExistingXLOG(void)
if
(
errno
)
if
(
errno
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not read from directory
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not read from directory
\"
%s
\"
: %s
\n
"
),
progname
,
XLogDir
,
strerror
(
errno
));
progname
,
XLogDir
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
@@ -644,7 +644,7 @@ WriteEmptyXLOG(void)
...
@@ -644,7 +644,7 @@ WriteEmptyXLOG(void)
S_IRUSR
|
S_IWUSR
);
S_IRUSR
|
S_IWUSR
);
if
(
fd
<
0
)
if
(
fd
<
0
)
{
{
fprintf
(
stderr
,
_
(
"%s: could not open
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not open
file
\"
%s
\"
: %s
\n
"
),
progname
,
path
,
strerror
(
errno
));
progname
,
path
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
@@ -655,7 +655,7 @@ WriteEmptyXLOG(void)
...
@@ -655,7 +655,7 @@ WriteEmptyXLOG(void)
/* if write didn't set errno, assume problem is no disk space */
/* if write didn't set errno, assume problem is no disk space */
if
(
errno
==
0
)
if
(
errno
==
0
)
errno
=
ENOSPC
;
errno
=
ENOSPC
;
fprintf
(
stderr
,
_
(
"%s: could not write
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not write
file
\"
%s
\"
: %s
\n
"
),
progname
,
path
,
strerror
(
errno
));
progname
,
path
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
@@ -669,7 +669,7 @@ WriteEmptyXLOG(void)
...
@@ -669,7 +669,7 @@ WriteEmptyXLOG(void)
{
{
if
(
errno
==
0
)
if
(
errno
==
0
)
errno
=
ENOSPC
;
errno
=
ENOSPC
;
fprintf
(
stderr
,
_
(
"%s: could not write
%s
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not write
file
\"
%s
\"
: %s
\n
"
),
progname
,
path
,
strerror
(
errno
));
progname
,
path
,
strerror
(
errno
));
exit
(
1
);
exit
(
1
);
}
}
...
...
src/bin/psql/command.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.9
7 2003/06/28 00:12:40 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.9
8 2003/07/23 08:47:38 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "command.h"
#include "command.h"
...
@@ -303,7 +303,7 @@ exec_command(const char *cmd,
...
@@ -303,7 +303,7 @@ exec_command(const char *cmd,
if
(
chdir
(
dir
)
==
-
1
)
if
(
chdir
(
dir
)
==
-
1
)
{
{
psql_error
(
"
\\
%s: could not change directory to
'%s'
: %s
\n
"
,
psql_error
(
"
\\
%s: could not change directory to
\"
%s
\"
: %s
\n
"
,
cmd
,
dir
,
strerror
(
errno
));
cmd
,
dir
,
strerror
(
errno
));
success
=
false
;
success
=
false
;
}
}
...
@@ -665,7 +665,7 @@ exec_command(const char *cmd,
...
@@ -665,7 +665,7 @@ exec_command(const char *cmd,
success
=
saveHistory
(
fname
?
fname
:
"/dev/tty"
);
success
=
saveHistory
(
fname
?
fname
:
"/dev/tty"
);
if
(
success
&&
!
quiet
&&
fname
)
if
(
success
&&
!
quiet
&&
fname
)
printf
(
gettext
(
"Wrote history to
%s
.
\n
"
),
fname
);
printf
(
gettext
(
"Wrote history to
file
\"
%s
\"
.
\n
"
),
fname
);
free
(
fname
);
free
(
fname
);
}
}
...
@@ -887,7 +887,7 @@ exec_command(const char *cmd,
...
@@ -887,7 +887,7 @@ exec_command(const char *cmd,
while
((
val
=
scan_option
(
&
string
,
OT_NORMAL
,
NULL
,
false
)))
while
((
val
=
scan_option
(
&
string
,
OT_NORMAL
,
NULL
,
false
)))
{
{
if
(
status
!=
CMD_UNKNOWN
)
if
(
status
!=
CMD_UNKNOWN
)
psql_error
(
"
\\
%s: extra argument
'%s'
ignored
\n
"
,
cmd
,
val
);
psql_error
(
"
\\
%s: extra argument
\"
%s
\"
ignored
\n
"
,
cmd
,
val
);
if
(
val
)
if
(
val
)
free
(
val
);
free
(
val
);
}
}
...
@@ -1425,12 +1425,12 @@ do_connect(const char *new_dbname, const char *new_user)
...
@@ -1425,12 +1425,12 @@ do_connect(const char *new_dbname, const char *new_user)
if
(
!
QUIET
())
if
(
!
QUIET
())
{
{
if
(
userparam
!=
new_user
)
/* no new user */
if
(
userparam
!=
new_user
)
/* no new user */
printf
(
gettext
(
"You are now connected to database
%s
.
\n
"
),
dbparam
);
printf
(
gettext
(
"You are now connected to database
\"
%s
\"
.
\n
"
),
dbparam
);
else
if
(
dbparam
!=
new_dbname
)
/* no new db */
else
if
(
dbparam
!=
new_dbname
)
/* no new db */
printf
(
gettext
(
"You are now connected as new user
%s
.
\n
"
),
new_user
);
printf
(
gettext
(
"You are now connected as new user
\"
%s
\"
.
\n
"
),
new_user
);
else
else
/* both new */
/* both new */
printf
(
gettext
(
"You are now connected to database
%s as user %s
.
\n
"
),
printf
(
gettext
(
"You are now connected to database
\"
%s
\"
as user
\"
%s
\"
.
\n
"
),
PQdb
(
pset
.
db
),
PQuser
(
pset
.
db
));
PQdb
(
pset
.
db
),
PQuser
(
pset
.
db
));
}
}
...
@@ -1552,7 +1552,7 @@ editFile(const char *fname)
...
@@ -1552,7 +1552,7 @@ editFile(const char *fname)
"%s '%s'"
,
editorName
,
fname
);
"%s '%s'"
,
editorName
,
fname
);
result
=
system
(
sys
);
result
=
system
(
sys
);
if
(
result
==
-
1
)
if
(
result
==
-
1
)
psql_error
(
"could not start editor
%s
\n
"
,
editorName
);
psql_error
(
"could not start editor
\"
%s
\"
\n
"
,
editorName
);
else
if
(
result
==
127
)
else
if
(
result
==
127
)
psql_error
(
"could not start /bin/sh
\n
"
);
psql_error
(
"could not start /bin/sh
\n
"
);
free
(
sys
);
free
(
sys
);
...
@@ -1599,7 +1599,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
...
@@ -1599,7 +1599,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
if
(
fd
==
-
1
||
!
stream
)
if
(
fd
==
-
1
||
!
stream
)
{
{
psql_error
(
"could not open temporary file
%s
: %s
\n
"
,
fname
,
strerror
(
errno
));
psql_error
(
"could not open temporary file
\"
%s
\"
: %s
\n
"
,
fname
,
strerror
(
errno
));
error
=
true
;
error
=
true
;
}
}
else
else
...
@@ -1828,7 +1828,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
...
@@ -1828,7 +1828,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt
->
nullPrint
=
xstrdup
(
value
);
popt
->
nullPrint
=
xstrdup
(
value
);
}
}
if
(
!
quiet
)
if
(
!
quiet
)
printf
(
gettext
(
"Null display is
'%s'
.
\n
"
),
popt
->
nullPrint
?
popt
->
nullPrint
:
""
);
printf
(
gettext
(
"Null display is
\"
%s
\"
.
\n
"
),
popt
->
nullPrint
?
popt
->
nullPrint
:
""
);
}
}
/* field separator for unaligned text */
/* field separator for unaligned text */
...
@@ -1840,7 +1840,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
...
@@ -1840,7 +1840,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
popt
->
topt
.
fieldSep
=
xstrdup
(
value
);
popt
->
topt
.
fieldSep
=
xstrdup
(
value
);
}
}
if
(
!
quiet
)
if
(
!
quiet
)
printf
(
gettext
(
"Field separator is
'%s'
.
\n
"
),
popt
->
topt
.
fieldSep
);
printf
(
gettext
(
"Field separator is
\"
%s
\"
.
\n
"
),
popt
->
topt
.
fieldSep
);
}
}
/* record separator for unaligned text */
/* record separator for unaligned text */
...
@@ -1856,7 +1856,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
...
@@ -1856,7 +1856,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if
(
strcmp
(
popt
->
topt
.
recordSep
,
"
\n
"
)
==
0
)
if
(
strcmp
(
popt
->
topt
.
recordSep
,
"
\n
"
)
==
0
)
printf
(
gettext
(
"Record separator is <newline>."
));
printf
(
gettext
(
"Record separator is <newline>."
));
else
else
printf
(
gettext
(
"Record separator is
'%s'
.
\n
"
),
popt
->
topt
.
recordSep
);
printf
(
gettext
(
"Record separator is
\"
%s
\"
.
\n
"
),
popt
->
topt
.
recordSep
);
}
}
}
}
...
@@ -1921,11 +1921,11 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
...
@@ -1921,11 +1921,11 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
if
(
!
quiet
)
if
(
!
quiet
)
{
{
if
(
popt
->
topt
.
pager
==
1
)
if
(
popt
->
topt
.
pager
==
1
)
puts
(
gettext
(
"Pager is
on (for long output)
."
));
puts
(
gettext
(
"Pager is
used for long output
."
));
else
if
(
popt
->
topt
.
pager
==
2
)
else
if
(
popt
->
topt
.
pager
==
2
)
puts
(
gettext
(
"Pager is always
(used)
."
));
puts
(
gettext
(
"Pager is always
used
."
));
else
else
puts
(
gettext
(
"Pager is off."
));
puts
(
gettext
(
"Pager
usage
is off."
));
}
}
}
}
...
...
src/bin/psql/common.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000 by PostgreSQL Global Development Group
* Copyright 2000 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.6
5 2003/06/28 00:12:40 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.6
6 2003/07/23 08:47:39 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "common.h"
#include "common.h"
...
@@ -425,7 +425,7 @@ PrintNotifications(void)
...
@@ -425,7 +425,7 @@ PrintNotifications(void)
while
((
notify
=
PQnotifies
(
pset
.
db
)))
while
((
notify
=
PQnotifies
(
pset
.
db
)))
{
{
fprintf
(
pset
.
queryFout
,
gettext
(
"Asynchronous
NOTIFY '%s' from backend with pid %d receive
d.
\n
"
),
fprintf
(
pset
.
queryFout
,
gettext
(
"Asynchronous
notification
\"
%s
\"
received from server process with PID %
d.
\n
"
),
notify
->
relname
,
notify
->
be_pid
);
notify
->
relname
,
notify
->
be_pid
);
PQfreemem
(
notify
);
PQfreemem
(
notify
);
fflush
(
pset
.
queryFout
);
fflush
(
pset
.
queryFout
);
...
@@ -585,7 +585,7 @@ SendQuery(const char *query)
...
@@ -585,7 +585,7 @@ SendQuery(const char *query)
{
{
char
buf
[
3
];
char
buf
[
3
];
printf
(
gettext
(
"***(Single step mode:
Verify query)**
*******************************************
\n
"
printf
(
gettext
(
"***(Single step mode:
verify command)
*******************************************
\n
"
"%s
\n
"
"%s
\n
"
"***(press return to proceed or enter x and return to cancel)********************
\n
"
),
"***(press return to proceed or enter x and return to cancel)********************
\n
"
),
query
);
query
);
...
...
src/bin/psql/copy.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000 by PostgreSQL Global Development Group
* Copyright 2000 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.3
0 2003/06/28 00:12:40 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.3
1 2003/07/23 08:47:39 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "copy.h"
#include "copy.h"
...
@@ -287,7 +287,7 @@ parse_slash_copy(const char *args)
...
@@ -287,7 +287,7 @@ parse_slash_copy(const char *args)
error:
error:
if
(
token
)
if
(
token
)
psql_error
(
"
\\
copy: parse error at
'%s'
\n
"
,
token
);
psql_error
(
"
\\
copy: parse error at
\"
%s
\"
\n
"
,
token
);
else
else
psql_error
(
"
\\
copy: parse error at end of line
\n
"
);
psql_error
(
"
\\
copy: parse error at end of line
\n
"
);
free_copy_options
(
result
);
free_copy_options
(
result
);
...
...
src/bin/psql/describe.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.7
8 2003/06/27 16:55:22 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.7
9 2003/07/23 08:47:39 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "describe.h"
#include "describe.h"
...
@@ -678,7 +678,7 @@ describeOneTableDetails(const char *schemaname,
...
@@ -678,7 +678,7 @@ describeOneTableDetails(const char *schemaname,
if
(
PQntuples
(
res
)
==
0
)
if
(
PQntuples
(
res
)
==
0
)
{
{
if
(
!
QUIET
())
if
(
!
QUIET
())
fprintf
(
stderr
,
_
(
"Did not find any relation with
oid
%s.
\n
"
),
fprintf
(
stderr
,
_
(
"Did not find any relation with
OID
%s.
\n
"
),
oid
);
oid
);
goto
error_return
;
goto
error_return
;
}
}
...
@@ -1049,16 +1049,16 @@ describeOneTableDetails(const char *schemaname,
...
@@ -1049,16 +1049,16 @@ describeOneTableDetails(const char *schemaname,
const
char
*
indexdef
;
const
char
*
indexdef
;
const
char
*
usingpos
;
const
char
*
usingpos
;
/* Output index
/constraint
name */
/* Output index name */
printfPQExpBuffer
(
&
buf
,
"
\"
%s
\"
"
,
printfPQExpBuffer
(
&
buf
,
_
(
"
\"
%s
\"
"
)
,
PQgetvalue
(
result1
,
i
,
0
));
PQgetvalue
(
result1
,
i
,
0
));
/* Label as primary key or unique (but not both) */
/* Label as primary key or unique (but not both) */
appendPQExpBuffer
(
&
buf
,
appendPQExpBuffer
(
&
buf
,
strcmp
(
PQgetvalue
(
result1
,
i
,
1
),
"t"
)
==
0
strcmp
(
PQgetvalue
(
result1
,
i
,
1
),
"t"
)
==
0
?
_
(
"
PRIMARY KEY
"
)
:
?
_
(
"
primary key,
"
)
:
(
strcmp
(
PQgetvalue
(
result1
,
i
,
2
),
"t"
)
==
0
(
strcmp
(
PQgetvalue
(
result1
,
i
,
2
),
"t"
)
==
0
?
_
(
"
UNIQUE
"
)
?
_
(
"
unique,
"
)
:
""
));
:
""
));
/* Everything after "USING" is echoed verbatim */
/* Everything after "USING" is echoed verbatim */
...
@@ -1069,24 +1069,19 @@ describeOneTableDetails(const char *schemaname,
...
@@ -1069,24 +1069,19 @@ describeOneTableDetails(const char *schemaname,
appendPQExpBuffer
(
&
buf
,
" %s"
,
indexdef
);
appendPQExpBuffer
(
&
buf
,
" %s"
,
indexdef
);
if
(
i
<
index_count
-
1
)
appendPQExpBuffer
(
&
buf
,
","
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
}
}
}
}
/* print check constraints */
/* print check constraints */
if
(
check_count
>
0
)
{
if
(
check_count
>
0
)
{
printfPQExpBuffer
(
&
buf
,
_
(
"Check
C
onstraints:"
));
printfPQExpBuffer
(
&
buf
,
_
(
"Check
c
onstraints:"
));
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
for
(
i
=
0
;
i
<
check_count
;
i
++
)
for
(
i
=
0
;
i
<
check_count
;
i
++
)
{
{
printfPQExpBuffer
(
&
buf
,
_
(
"
\"
%s
\"
CHECK %s"
),
printfPQExpBuffer
(
&
buf
,
_
(
"
\"
%s
\"
CHECK %s"
),
PQgetvalue
(
result2
,
i
,
1
),
PQgetvalue
(
result2
,
i
,
1
),
PQgetvalue
(
result2
,
i
,
0
));
PQgetvalue
(
result2
,
i
,
0
));
if
(
i
<
check_count
-
1
)
appendPQExpBuffer
(
&
buf
,
","
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
}
}
...
@@ -1094,15 +1089,13 @@ describeOneTableDetails(const char *schemaname,
...
@@ -1094,15 +1089,13 @@ describeOneTableDetails(const char *schemaname,
/* print foreign key constraints */
/* print foreign key constraints */
if
(
foreignkey_count
>
0
)
{
if
(
foreignkey_count
>
0
)
{
printfPQExpBuffer
(
&
buf
,
_
(
"Foreign
Key C
onstraints:"
));
printfPQExpBuffer
(
&
buf
,
_
(
"Foreign
-key c
onstraints:"
));
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
for
(
i
=
0
;
i
<
foreignkey_count
;
i
++
)
for
(
i
=
0
;
i
<
foreignkey_count
;
i
++
)
{
{
printfPQExpBuffer
(
&
buf
,
_
(
"
\"
%s
\"
%s"
),
printfPQExpBuffer
(
&
buf
,
_
(
"
\"
%s
\"
%s"
),
PQgetvalue
(
result5
,
i
,
0
),
PQgetvalue
(
result5
,
i
,
0
),
PQgetvalue
(
result5
,
i
,
1
));
PQgetvalue
(
result5
,
i
,
1
));
if
(
i
<
foreignkey_count
-
1
)
appendPQExpBuffer
(
&
buf
,
","
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
}
}
...
@@ -1122,9 +1115,6 @@ describeOneTableDetails(const char *schemaname,
...
@@ -1122,9 +1115,6 @@ describeOneTableDetails(const char *schemaname,
printfPQExpBuffer
(
&
buf
,
" %s"
,
ruledef
);
printfPQExpBuffer
(
&
buf
,
" %s"
,
ruledef
);
if
(
i
<
rule_count
-
1
)
appendPQExpBuffer
(
&
buf
,
","
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
}
}
}
}
...
@@ -1146,9 +1136,6 @@ describeOneTableDetails(const char *schemaname,
...
@@ -1146,9 +1136,6 @@ describeOneTableDetails(const char *schemaname,
printfPQExpBuffer
(
&
buf
,
" %s"
,
tgdef
);
printfPQExpBuffer
(
&
buf
,
" %s"
,
tgdef
);
if
(
i
<
trigger_count
-
1
)
appendPQExpBuffer
(
&
buf
,
","
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
footers
[
count_footers
++
]
=
xstrdup
(
buf
.
data
);
}
}
}
}
...
@@ -1496,9 +1483,9 @@ listCasts(const char *pattern)
...
@@ -1496,9 +1483,9 @@ listCasts(const char *pattern)
"FROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p
\n
"
"FROM pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p
\n
"
" ON c.castfunc = p.oid
\n
"
" ON c.castfunc = p.oid
\n
"
"ORDER BY 1, 2"
,
"ORDER BY 1, 2"
,
_
(
"Source"
),
_
(
"Source
type
"
),
_
(
"Target"
),
_
(
"Target
type
"
),
_
(
"
BINARY
"
),
_
(
"
(binary compatible)
"
),
_
(
"Function"
),
_
(
"Function"
),
_
(
"no"
),
_
(
"no"
),
_
(
"in assignment"
),
_
(
"in assignment"
),
...
...
src/bin/psql/help.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000 by PostgreSQL Global Development Group
* Copyright 2000 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.7
3 2003/06/11 05:13:11 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.7
4 2003/07/23 08:47:39 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "common.h"
#include "common.h"
...
@@ -90,11 +90,11 @@ usage(void)
...
@@ -90,11 +90,11 @@ usage(void)
env
=
getenv
(
"PGDATABASE"
);
env
=
getenv
(
"PGDATABASE"
);
if
(
!
env
)
if
(
!
env
)
env
=
user
;
env
=
user
;
printf
(
_
(
" -d DBNAME specify database name to connect to (default:
%s
)
\n
"
),
env
);
printf
(
_
(
" -d DBNAME specify database name to connect to (default:
\"
%s
\"
)
\n
"
),
env
);
puts
(
_
(
" -c COMMAND run only single command (SQL or internal) and exit"
));
puts
(
_
(
" -c COMMAND run only single command (SQL or internal) and exit"
));
puts
(
_
(
" -f FILENAME execute commands from file, then exit"
));
puts
(
_
(
" -f FILENAME execute commands from file, then exit"
));
puts
(
_
(
" -l list available databases, then exit"
));
puts
(
_
(
" -l list available databases, then exit"
));
puts
(
_
(
" -v NAME=VALUE set psql variable
'NAME' to 'VALUE'
"
));
puts
(
_
(
" -v NAME=VALUE set psql variable
NAME to VALUE
"
));
puts
(
_
(
" -X do not read startup file (~/.psqlrc)"
));
puts
(
_
(
" -X do not read startup file (~/.psqlrc)"
));
puts
(
_
(
" --help show this help, then exit"
));
puts
(
_
(
" --help show this help, then exit"
));
puts
(
_
(
" --version output version information, then exit"
));
puts
(
_
(
" --version output version information, then exit"
));
...
@@ -106,8 +106,8 @@ usage(void)
...
@@ -106,8 +106,8 @@ usage(void)
puts
(
_
(
" -q run quietly (no messages, only query output)"
));
puts
(
_
(
" -q run quietly (no messages, only query output)"
));
puts
(
_
(
" -o FILENAME send query results to file (or |pipe)"
));
puts
(
_
(
" -o FILENAME send query results to file (or |pipe)"
));
puts
(
_
(
" -n disable enhanced command line editing (readline)"
));
puts
(
_
(
" -n disable enhanced command line editing (readline)"
));
puts
(
_
(
" -s single
step mode (confirm each query)"
));
puts
(
_
(
" -s single
-
step mode (confirm each query)"
));
puts
(
_
(
" -S single
line mode (end of line terminates SQL command)"
));
puts
(
_
(
" -S single
-
line mode (end of line terminates SQL command)"
));
puts
(
_
(
"
\n
Output format options:"
));
puts
(
_
(
"
\n
Output format options:"
));
puts
(
_
(
" -A unaligned table output mode (-P format=unaligned)"
));
puts
(
_
(
" -A unaligned table output mode (-P format=unaligned)"
));
...
@@ -115,7 +115,7 @@ usage(void)
...
@@ -115,7 +115,7 @@ usage(void)
puts
(
_
(
" -t print rows only (-P tuples_only)"
));
puts
(
_
(
" -t print rows only (-P tuples_only)"
));
puts
(
_
(
" -T TEXT set HTML table tag attributes (width, border) (-P tableattr=)"
));
puts
(
_
(
" -T TEXT set HTML table tag attributes (width, border) (-P tableattr=)"
));
puts
(
_
(
" -x turn on expanded table output (-P expanded)"
));
puts
(
_
(
" -x turn on expanded table output (-P expanded)"
));
puts
(
_
(
" -P VAR[=ARG] set printing option
'VAR' to 'ARG'
(see
\\
pset command)"
));
puts
(
_
(
" -P VAR[=ARG] set printing option
VAR to ARG
(see
\\
pset command)"
));
printf
(
_
(
" -F STRING set field separator (default:
\"
%s
\"
) (-P fieldsep=)
\n
"
),
printf
(
_
(
" -F STRING set field separator (default:
\"
%s
\"
) (-P fieldsep=)
\n
"
),
DEFAULT_FIELD_SEP
);
DEFAULT_FIELD_SEP
);
puts
(
_
(
" -R STRING set record separator (default: newline) (-P recordsep=)"
));
puts
(
_
(
" -R STRING set record separator (default: newline) (-P recordsep=)"
));
...
@@ -123,17 +123,17 @@ usage(void)
...
@@ -123,17 +123,17 @@ usage(void)
puts
(
_
(
"
\n
Connection options:"
));
puts
(
_
(
"
\n
Connection options:"
));
/* Display default host */
/* Display default host */
env
=
getenv
(
"PGHOST"
);
env
=
getenv
(
"PGHOST"
);
printf
(
_
(
" -h HOSTNAME
specify database server host or socket directory (default: %s
)
\n
"
),
printf
(
_
(
" -h HOSTNAME
database server host or socket directory (default:
\"
%s
\"
)
\n
"
),
env
?
env
:
_
(
"local socket"
));
env
?
env
:
_
(
"local socket"
));
/* Display default port */
/* Display default port */
env
=
getenv
(
"PGPORT"
);
env
=
getenv
(
"PGPORT"
);
printf
(
_
(
" -p PORT
specify database server port (default: %s
)
\n
"
),
printf
(
_
(
" -p PORT
database server port (default:
\"
%s
\"
)
\n
"
),
env
?
env
:
DEF_PGPORT_STR
);
env
?
env
:
DEF_PGPORT_STR
);
/* Display default user */
/* Display default user */
env
=
getenv
(
"PGUSER"
);
env
=
getenv
(
"PGUSER"
);
if
(
!
env
)
if
(
!
env
)
env
=
user
;
env
=
user
;
printf
(
_
(
" -U NAME
specify database user name (default: %s
)
\n
"
),
env
);
printf
(
_
(
" -U NAME
database user name (default:
\"
%s
\"
)
\n
"
),
env
);
puts
(
_
(
" -W prompt for password (should happen automatically)"
));
puts
(
_
(
" -W prompt for password (should happen automatically)"
));
puts
(
_
(
puts
(
_
(
...
@@ -177,15 +177,17 @@ slashUsage(unsigned short int pager)
...
@@ -177,15 +177,17 @@ slashUsage(unsigned short int pager)
PQdb
(
pset
.
db
));
PQdb
(
pset
.
db
));
fprintf
(
output
,
_
(
"
\\
cd [DIR] change the current working directory
\n
"
));
fprintf
(
output
,
_
(
"
\\
cd [DIR] change the current working directory
\n
"
));
fprintf
(
output
,
_
(
"
\\
copyright show PostgreSQL usage and distribution terms
\n
"
));
fprintf
(
output
,
_
(
"
\\
copyright show PostgreSQL usage and distribution terms
\n
"
));
fprintf
(
output
,
_
(
"
\\
encoding [ENCODING] show or set client encoding
\n
"
));
fprintf
(
output
,
_
(
"
\\
encoding [ENCODING]
\n
"
" show or set client encoding
\n
"
));
fprintf
(
output
,
_
(
"
\\
h [NAME] help on syntax of SQL commands, * for all commands
\n
"
));
fprintf
(
output
,
_
(
"
\\
h [NAME] help on syntax of SQL commands, * for all commands
\n
"
));
fprintf
(
output
,
_
(
"
\\
q quit psql
\n
"
));
fprintf
(
output
,
_
(
"
\\
q quit psql
\n
"
));
fprintf
(
output
,
_
(
"
\\
set [NAME [VALUE]] set internal variable, or list all if no parameters
\n
"
));
fprintf
(
output
,
_
(
"
\\
set [NAME [VALUE]]
\n
"
" set internal variable, or list all if no parameters
\n
"
));
fprintf
(
output
,
_
(
"
\\
timing toggle timing of commands (currently %s)
\n
"
),
fprintf
(
output
,
_
(
"
\\
timing toggle timing of commands (currently %s)
\n
"
),
ON
(
pset
.
timing
));
ON
(
pset
.
timing
));
fprintf
(
output
,
_
(
"
\\
unset NAME unset (delete) internal variable
\n
"
));
fprintf
(
output
,
_
(
"
\\
unset NAME unset (delete) internal variable
\n
"
));
fprintf
(
output
,
_
(
"
\\
! [COMMAND] execute command in shell or start interactive shell
\n
"
));
fprintf
(
output
,
_
(
"
\\
! [COMMAND] execute command in shell or start interactive shell
\n
"
));
fprintf
(
output
,
_
(
"
\n
"
)
);
fprintf
(
output
,
"
\n
"
);
fprintf
(
output
,
_
(
"Query Buffer
\n
"
));
fprintf
(
output
,
_
(
"Query Buffer
\n
"
));
fprintf
(
output
,
_
(
"
\\
e [FILE] edit the query buffer (or file) with external editor
\n
"
));
fprintf
(
output
,
_
(
"
\\
e [FILE] edit the query buffer (or file) with external editor
\n
"
));
...
@@ -194,12 +196,15 @@ slashUsage(unsigned short int pager)
...
@@ -194,12 +196,15 @@ slashUsage(unsigned short int pager)
fprintf
(
output
,
_
(
"
\\
r reset (clear) the query buffer
\n
"
));
fprintf
(
output
,
_
(
"
\\
r reset (clear) the query buffer
\n
"
));
fprintf
(
output
,
_
(
"
\\
s [FILE] display history or save it to file
\n
"
));
fprintf
(
output
,
_
(
"
\\
s [FILE] display history or save it to file
\n
"
));
fprintf
(
output
,
_
(
"
\\
w [FILE] write query buffer to file
\n
"
));
fprintf
(
output
,
_
(
"
\\
w [FILE] write query buffer to file
\n
"
));
fprintf
(
output
,
_
(
"
\n
"
)
);
fprintf
(
output
,
"
\n
"
);
fprintf
(
output
,
_
(
"Input/Output
\n
"
));
fprintf
(
output
,
_
(
"Input/Output
\n
"
));
fprintf
(
output
,
_
(
"
\\
echo [STRING] write string to standard output
\n
"
));
fprintf
(
output
,
_
(
"
\\
i FILE execute commands from file
\n
"
));
fprintf
(
output
,
_
(
"
\\
i FILE execute commands from file
\n
"
));
fprintf
(
output
,
_
(
"
\\
o [FILE] send all query results to file or |pipe
\n
"
));
fprintf
(
output
,
_
(
"
\\
o [FILE] send all query results to file or |pipe
\n
"
));
fprintf
(
output
,
_
(
"
\n
"
));
fprintf
(
output
,
_
(
"
\\
qecho [STRING]
\n
"
" write string to query output stream (see
\\
o)
\n
"
));
fprintf
(
output
,
"
\n
"
);
fprintf
(
output
,
_
(
"Informational
\n
"
));
fprintf
(
output
,
_
(
"Informational
\n
"
));
fprintf
(
output
,
_
(
"
\\
d [NAME] describe table, index, sequence, or view
\n
"
));
fprintf
(
output
,
_
(
"
\\
d [NAME] describe table, index, sequence, or view
\n
"
));
...
@@ -219,32 +224,31 @@ slashUsage(unsigned short int pager)
...
@@ -219,32 +224,31 @@ slashUsage(unsigned short int pager)
fprintf
(
output
,
_
(
"
\\
du [PATTERN] list users
\n
"
));
fprintf
(
output
,
_
(
"
\\
du [PATTERN] list users
\n
"
));
fprintf
(
output
,
_
(
"
\\
l list all databases (add
\"
+
\"
for more detail)
\n
"
));
fprintf
(
output
,
_
(
"
\\
l list all databases (add
\"
+
\"
for more detail)
\n
"
));
fprintf
(
output
,
_
(
"
\\
z [PATTERN] list table access privileges (same as
\\
dp)
\n
"
));
fprintf
(
output
,
_
(
"
\\
z [PATTERN] list table access privileges (same as
\\
dp)
\n
"
));
fprintf
(
output
,
_
(
"
\n
"
)
);
fprintf
(
output
,
"
\n
"
);
fprintf
(
output
,
_
(
"Formatting
\n
"
));
fprintf
(
output
,
_
(
"Formatting
\n
"
));
fprintf
(
output
,
_
(
"
\\
a toggle between unaligned and aligned output mode
\n
"
));
fprintf
(
output
,
_
(
"
\\
a toggle between unaligned and aligned output mode
\n
"
));
fprintf
(
output
,
_
(
"
\\
C [STRING] set table title, or unset if none
\n
"
));
fprintf
(
output
,
_
(
"
\\
C [STRING] set table title, or unset if none
\n
"
));
fprintf
(
output
,
_
(
"
\\
echo [STRING] write string to standard output
\n
"
));
fprintf
(
output
,
_
(
"
\\
f [STRING] show or set field separator for unaligned query output
\n
"
));
fprintf
(
output
,
_
(
"
\\
f [STRING] show or set field separator for unaligned query output
\n
"
));
fprintf
(
output
,
_
(
"
\\
H toggle HTML output mode (currently %s)
\n
"
),
fprintf
(
output
,
_
(
"
\\
H toggle HTML output mode (currently %s)
\n
"
),
ON
(
pset
.
popt
.
topt
.
format
==
PRINT_HTML
));
ON
(
pset
.
popt
.
topt
.
format
==
PRINT_HTML
));
fprintf
(
output
,
_
(
"
\\
pset NAME [VALUE] set table output option
\n
"
fprintf
(
output
,
_
(
"
\\
pset NAME [VALUE]
\n
"
" set table output option
\n
"
" (NAME := {format|border|expanded|fieldsep|null|recordsep|
\n
"
" (NAME := {format|border|expanded|fieldsep|null|recordsep|
\n
"
" tuples_only|title|tableattr|pager})
\n
"
));
" tuples_only|title|tableattr|pager})
\n
"
));
fprintf
(
output
,
_
(
"
\\
qecho [STRING] write string to query output stream (see
\\
o)
\n
"
));
fprintf
(
output
,
_
(
"
\\
t show only rows (currently %s)
\n
"
),
fprintf
(
output
,
_
(
"
\\
t show only rows (currently %s)
\n
"
),
ON
(
pset
.
popt
.
topt
.
tuples_only
));
ON
(
pset
.
popt
.
topt
.
tuples_only
));
fprintf
(
output
,
_
(
"
\\
T [STRING] set HTML <table> tag attributes, or unset if none
\n
"
));
fprintf
(
output
,
_
(
"
\\
T [STRING] set HTML <table> tag attributes, or unset if none
\n
"
));
fprintf
(
output
,
_
(
"
\\
x toggle expanded output (currently %s)
\n
"
),
fprintf
(
output
,
_
(
"
\\
x toggle expanded output (currently %s)
\n
"
),
ON
(
pset
.
popt
.
topt
.
expanded
));
ON
(
pset
.
popt
.
topt
.
expanded
));
fprintf
(
output
,
_
(
"
\n
"
)
);
fprintf
(
output
,
"
\n
"
);
fprintf
(
output
,
_
(
"Copy, Large Object
\n
"
));
fprintf
(
output
,
_
(
"Copy, Large Object
\n
"
));
fprintf
(
output
,
_
(
"
\\
copy ... perform SQL COPY with data stream to the client host
\n
"
));
fprintf
(
output
,
_
(
"
\\
copy ... perform SQL COPY with data stream to the client host
\n
"
));
fprintf
(
output
,
_
(
"
\\
lo_export
\n
"
));
fprintf
(
output
,
_
(
"
\\
lo_export
\n
"
fprintf
(
output
,
_
(
"
\\
lo_import
\n
"
));
"
\\
lo_import
\n
"
fprintf
(
output
,
_
(
"
\\
lo_list
\n
"
));
"
\\
lo_list
\n
"
fprintf
(
output
,
_
(
"
\\
lo_unlink large object operations
\n
"
));
"
\\
lo_unlink large object operations
\n
"
));
if
(
output
!=
stdout
)
if
(
output
!=
stdout
)
{
{
...
@@ -323,7 +327,7 @@ helpSQL(const char *topic, unsigned short int pager)
...
@@ -323,7 +327,7 @@ helpSQL(const char *topic, unsigned short int pager)
}
}
if
(
!
help_found
)
if
(
!
help_found
)
printf
(
_
(
"No help available for
'%-.*s'
.
\n
Try
\\
h with no arguments to see available help.
\n
"
),
(
int
)
len
,
topic
);
printf
(
_
(
"No help available for
\"
%-.*s
\"
.
\n
Try
\\
h with no arguments to see available help.
\n
"
),
(
int
)
len
,
topic
);
}
}
}
}
...
...
src/bin/psql/input.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000 by PostgreSQL Global Development Group
* Copyright 2000 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.2
3 2003/03/20 06:43:35 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.2
4 2003/07/23 08:47:39 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
#include "input.h"
#include "input.h"
...
@@ -204,7 +204,7 @@ saveHistory(char *fname)
...
@@ -204,7 +204,7 @@ saveHistory(char *fname)
if
(
write_history
(
fname
)
==
0
)
if
(
write_history
(
fname
)
==
0
)
return
true
;
return
true
;
psql_error
(
"could not save history to
%s
: %s
\n
"
,
fname
,
strerror
(
errno
));
psql_error
(
"could not save history to
file
\"
%s
\"
: %s
\n
"
,
fname
,
strerror
(
errno
));
}
}
#endif
#endif
...
...
src/bin/psql/startup.c
View file @
c154fc3a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000 by PostgreSQL Global Development Group
* Copyright 2000 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.7
4 2003/06/28 00:12:40 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.7
5 2003/07/23 08:47:40 petere
Exp $
*/
*/
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -421,7 +421,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -421,7 +421,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
if
(
!
result
)
if
(
!
result
)
{
{
fprintf
(
stderr
,
gettext
(
"%s: couldn't set printing parameter
%s
\n
"
),
pset
.
progname
,
value
);
fprintf
(
stderr
,
gettext
(
"%s: couldn't set printing parameter
\"
%s
\"
\n
"
),
pset
.
progname
,
value
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -467,7 +467,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -467,7 +467,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
{
{
if
(
!
DeleteVariable
(
pset
.
vars
,
value
))
if
(
!
DeleteVariable
(
pset
.
vars
,
value
))
{
{
fprintf
(
stderr
,
gettext
(
"%s: could not delete variable
%s
\n
"
),
fprintf
(
stderr
,
gettext
(
"%s: could not delete variable
\"
%s
\"
\n
"
),
pset
.
progname
,
value
);
pset
.
progname
,
value
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -477,7 +477,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -477,7 +477,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
*
equal_loc
=
'\0'
;
*
equal_loc
=
'\0'
;
if
(
!
SetVariable
(
pset
.
vars
,
value
,
equal_loc
+
1
))
if
(
!
SetVariable
(
pset
.
vars
,
value
,
equal_loc
+
1
))
{
{
fprintf
(
stderr
,
gettext
(
"%s: could not set variable
%s
\n
"
),
fprintf
(
stderr
,
gettext
(
"%s: could not set variable
\"
%s
\"
\n
"
),
pset
.
progname
,
value
);
pset
.
progname
,
value
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -508,13 +508,13 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -508,13 +508,13 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
/* unknown option reported by getopt */
/* unknown option reported by getopt */
else
else
{
{
fprintf
(
stderr
,
gettext
(
"Try
'%s --help'
for more information.
\n
"
),
fprintf
(
stderr
,
gettext
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
pset
.
progname
);
pset
.
progname
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
break
;
break
;
default:
default:
fprintf
(
stderr
,
gettext
(
"Try
'%s --help'
for more information.
\n
"
),
fprintf
(
stderr
,
gettext
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
pset
.
progname
);
pset
.
progname
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
break
;
break
;
...
@@ -532,7 +532,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
...
@@ -532,7 +532,7 @@ parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
else
if
(
!
options
->
username
)
else
if
(
!
options
->
username
)
options
->
username
=
argv
[
optind
];
options
->
username
=
argv
[
optind
];
else
if
(
!
QUIET
())
else
if
(
!
QUIET
())
fprintf
(
stderr
,
gettext
(
"%s: warning: extra
option %s
ignored
\n
"
),
fprintf
(
stderr
,
gettext
(
"%s: warning: extra
command-line argument
\"
%s
\"
ignored
\n
"
),
pset
.
progname
,
argv
[
optind
]);
pset
.
progname
,
argv
[
optind
]);
optind
++
;
optind
++
;
...
...
src/bin/scripts/clusterdb.c
View file @
c154fc3a
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*
*
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/clusterdb.c,v 1.
1 2003/06/18 12:19:1
1 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/clusterdb.c,v 1.
2 2003/07/23 08:47:4
1 petere Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
...
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
table
=
optarg
;
table
=
optarg
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -104,9 +104,9 @@ main(int argc, char *argv[])
...
@@ -104,9 +104,9 @@ main(int argc, char *argv[])
dbname
=
argv
[
optind
];
dbname
=
argv
[
optind
];
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
+
1
]);
progname
,
argv
[
optind
+
1
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -224,13 +224,13 @@ void cluster_all_databases(const char *host, const char *port, const char *usern
...
@@ -224,13 +224,13 @@ void cluster_all_databases(const char *host, const char *port, const char *usern
static
void
static
void
help
(
const
char
*
progname
)
help
(
const
char
*
progname
)
{
{
printf
(
_
(
"%s clusters all previously clustered tables in a database.
\n
"
),
progname
);
printf
(
_
(
"%s clusters all previously clustered tables in a database.
\n
\n
"
),
progname
);
printf
(
_
(
"Usage:
\n
"
));
printf
(
_
(
"Usage:
\n
"
));
printf
(
_
(
" %s [OPTION]... [DBNAME]
\n
"
),
progname
);
printf
(
_
(
" %s [OPTION]... [DBNAME]
\n
"
),
progname
);
printf
(
_
(
"
\n
Options:
\n
"
));
printf
(
_
(
"
\n
Options:
\n
"
));
printf
(
_
(
" -a, --all cluster all databases
\n
"
));
printf
(
_
(
" -a, --all cluster all databases
\n
"
));
printf
(
_
(
" -d, --dbname=DBNAME database to cluster
\n
"
));
printf
(
_
(
" -d, --dbname=DBNAME database to cluster
\n
"
));
printf
(
_
(
" -t, --table=TABLE cluster specific table only"
));
printf
(
_
(
" -t, --table=TABLE cluster specific table only
\n
"
));
printf
(
_
(
" -e, --echo show the commands being sent to the server
\n
"
));
printf
(
_
(
" -e, --echo show the commands being sent to the server
\n
"
));
printf
(
_
(
" -q, --quiet don't write any messages
\n
"
));
printf
(
_
(
" -q, --quiet don't write any messages
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n
"
));
...
...
src/bin/scripts/createdb.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/createdb.c,v 1.
3 2003/06/11 05:13:12 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/createdb.c,v 1.
4 2003/07/23 08:47:41 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -98,7 +98,7 @@ main(int argc, char *argv[])
...
@@ -98,7 +98,7 @@ main(int argc, char *argv[])
encoding
=
optarg
;
encoding
=
optarg
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -115,9 +115,9 @@ main(int argc, char *argv[])
...
@@ -115,9 +115,9 @@ main(int argc, char *argv[])
comment
=
argv
[
optind
+
1
];
comment
=
argv
[
optind
+
1
];
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
+
2
]);
progname
,
argv
[
optind
+
2
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
...
src/bin/scripts/createlang.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/createlang.c,v 1.
4 2003/06/30 18:31:42 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/createlang.c,v 1.
5 2003/07/23 08:47:41 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
...
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
echo
=
true
;
echo
=
true
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -110,9 +110,9 @@ main(int argc, char *argv[])
...
@@ -110,9 +110,9 @@ main(int argc, char *argv[])
if
(
argc
-
optind
>
0
)
if
(
argc
-
optind
>
0
)
{
{
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
]);
progname
,
argv
[
optind
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -154,7 +154,7 @@ main(int argc, char *argv[])
...
@@ -154,7 +154,7 @@ main(int argc, char *argv[])
if
(
langname
==
NULL
)
if
(
langname
==
NULL
)
{
{
fprintf
(
stderr
,
_
(
"%s: missing required argument language name
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: missing required argument language name
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
...
src/bin/scripts/createuser.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.
4 2003/06/11 05:13:12 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.
5 2003/07/23 08:47:41 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
...
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
encrypted
=
-
1
;
encrypted
=
-
1
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -126,9 +126,9 @@ main(int argc, char *argv[])
...
@@ -126,9 +126,9 @@ main(int argc, char *argv[])
newuser
=
argv
[
optind
];
newuser
=
argv
[
optind
];
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
+
1
]);
progname
,
argv
[
optind
+
1
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
...
src/bin/scripts/dropdb.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/dropdb.c,v 1.
4 2003/06/11 05:13:12 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/dropdb.c,v 1.
5 2003/07/23 08:47:41 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
...
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
interactive
=
true
;
interactive
=
true
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -89,15 +89,15 @@ main(int argc, char *argv[])
...
@@ -89,15 +89,15 @@ main(int argc, char *argv[])
{
{
case
0
:
case
0
:
fprintf
(
stderr
,
_
(
"%s: missing required argument database name
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: missing required argument database name
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
case
1
:
case
1
:
dbname
=
argv
[
optind
];
dbname
=
argv
[
optind
];
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
+
1
]);
progname
,
argv
[
optind
+
1
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -105,7 +105,7 @@ main(int argc, char *argv[])
...
@@ -105,7 +105,7 @@ main(int argc, char *argv[])
{
{
char
*
reply
;
char
*
reply
;
printf
(
_
(
"Database
\"
%s
\"
will be permanently
delet
ed.
\n
"
),
dbname
);
printf
(
_
(
"Database
\"
%s
\"
will be permanently
remov
ed.
\n
"
),
dbname
);
reply
=
simple_prompt
(
"Are you sure? (y/n) "
,
1
,
true
);
reply
=
simple_prompt
(
"Are you sure? (y/n) "
,
1
,
true
);
if
(
check_yesno_response
(
reply
)
!=
1
)
if
(
check_yesno_response
(
reply
)
!=
1
)
exit
(
0
);
exit
(
0
);
...
...
src/bin/scripts/droplang.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/droplang.c,v 1.
3 2003/06/11 05:13:12 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/droplang.c,v 1.
4 2003/07/23 08:47:41 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
...
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
echo
=
true
;
echo
=
true
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -104,9 +104,9 @@ main(int argc, char *argv[])
...
@@ -104,9 +104,9 @@ main(int argc, char *argv[])
if
(
argc
-
optind
>
0
)
if
(
argc
-
optind
>
0
)
{
{
fprintf
(
stderr
,
_
(
"%s: too many command
line options (first is '%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command
-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
]);
progname
,
argv
[
optind
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -148,7 +148,7 @@ main(int argc, char *argv[])
...
@@ -148,7 +148,7 @@ main(int argc, char *argv[])
if
(
langname
==
NULL
)
if
(
langname
==
NULL
)
{
{
fprintf
(
stderr
,
_
(
"%s: missing required argument language name
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: missing required argument language name
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -182,7 +182,7 @@ main(int argc, char *argv[])
...
@@ -182,7 +182,7 @@ main(int argc, char *argv[])
{
{
PQfinish
(
conn
);
PQfinish
(
conn
);
fprintf
(
stderr
,
fprintf
(
stderr
,
_
(
"%s:
There are %s functions declared in language
\"
%s
\"
. Language not removed.
\n
"
),
_
(
"%s:
still %s functions declared in language
\"
%s
\"
; language not removed
\n
"
),
progname
,
PQgetvalue
(
result
,
0
,
0
),
langname
);
progname
,
PQgetvalue
(
result
,
0
,
0
),
langname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -241,7 +241,7 @@ help(const char *progname)
...
@@ -241,7 +241,7 @@ help(const char *progname)
printf
(
_
(
"Usage:
\n
"
));
printf
(
_
(
"Usage:
\n
"
));
printf
(
_
(
" %s [OPTION]... LANGNAME [DBNAME]
\n
"
),
progname
);
printf
(
_
(
" %s [OPTION]... LANGNAME [DBNAME]
\n
"
),
progname
);
printf
(
_
(
"
\n
Options:
\n
"
));
printf
(
_
(
"
\n
Options:
\n
"
));
printf
(
_
(
" -d, --dbname=DBNAME database
to install language in
\n
"
));
printf
(
_
(
" -d, --dbname=DBNAME database
from which to remove the language
\n
"
));
printf
(
_
(
" -e, --echo show the commands being sent to the server
\n
"
));
printf
(
_
(
" -e, --echo show the commands being sent to the server
\n
"
));
printf
(
_
(
" -l, --list show a list of currently installed languages
\n
"
));
printf
(
_
(
" -l, --list show a list of currently installed languages
\n
"
));
printf
(
_
(
" -h, --host=HOSTNAME database server host or socket directory
\n
"
));
printf
(
_
(
" -h, --host=HOSTNAME database server host or socket directory
\n
"
));
...
...
src/bin/scripts/dropuser.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/dropuser.c,v 1.
4 2003/06/11 05:13:12 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/dropuser.c,v 1.
5 2003/07/23 08:47:41 petere
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
...
@@ -80,7 +80,7 @@ main(int argc, char *argv[])
interactive
=
true
;
interactive
=
true
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -93,9 +93,9 @@ main(int argc, char *argv[])
...
@@ -93,9 +93,9 @@ main(int argc, char *argv[])
dropuser
=
argv
[
optind
];
dropuser
=
argv
[
optind
];
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
+
1
]);
progname
,
argv
[
optind
+
1
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -106,7 +106,7 @@ main(int argc, char *argv[])
...
@@ -106,7 +106,7 @@ main(int argc, char *argv[])
{
{
char
*
reply
;
char
*
reply
;
printf
(
_
(
"User
\"
%s
\"
will be permanently
delet
ed.
\n
"
),
dropuser
);
printf
(
_
(
"User
\"
%s
\"
will be permanently
remov
ed.
\n
"
),
dropuser
);
reply
=
simple_prompt
(
"Are you sure? (y/n) "
,
1
,
true
);
reply
=
simple_prompt
(
"Are you sure? (y/n) "
,
1
,
true
);
if
(
check_yesno_response
(
reply
)
!=
1
)
if
(
check_yesno_response
(
reply
)
!=
1
)
exit
(
0
);
exit
(
0
);
...
@@ -123,7 +123,7 @@ main(int argc, char *argv[])
...
@@ -123,7 +123,7 @@ main(int argc, char *argv[])
if
(
PQresultStatus
(
result
)
!=
PGRES_COMMAND_OK
)
if
(
PQresultStatus
(
result
)
!=
PGRES_COMMAND_OK
)
{
{
fprintf
(
stderr
,
_
(
"%s:
deletion of user %s
failed: %s"
),
fprintf
(
stderr
,
_
(
"%s:
removal of user
\"
%s
\"
failed: %s"
),
progname
,
dropuser
,
PQerrorMessage
(
conn
));
progname
,
dropuser
,
PQerrorMessage
(
conn
));
PQfinish
(
conn
);
PQfinish
(
conn
);
exit
(
1
);
exit
(
1
);
...
...
src/bin/scripts/vacuumdb.c
View file @
c154fc3a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/scripts/vacuumdb.c,v 1.
1 2003/06/18 12:19:1
1 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/vacuumdb.c,v 1.
2 2003/07/23 08:47:4
1 petere Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -107,7 +107,7 @@ main(int argc, char *argv[])
...
@@ -107,7 +107,7 @@ main(int argc, char *argv[])
verbose
=
true
;
verbose
=
true
;
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
@@ -120,9 +120,9 @@ main(int argc, char *argv[])
...
@@ -120,9 +120,9 @@ main(int argc, char *argv[])
dbname
=
argv
[
optind
];
dbname
=
argv
[
optind
];
break
;
break
;
default:
default:
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
'%s'
)
\n
"
),
fprintf
(
stderr
,
_
(
"%s: too many command-line arguments (first is
\"
%s
\"
)
\n
"
),
progname
,
argv
[
optind
+
1
]);
progname
,
argv
[
optind
+
1
]);
fprintf
(
stderr
,
_
(
"Try
'%s --help'
for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"Try
\"
%s --help
\"
for more information.
\n
"
),
progname
);
exit
(
1
);
exit
(
1
);
}
}
...
...
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