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
cd7569a5
Commit
cd7569a5
authored
Nov 30, 2012
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dummy commit
parent
db00d837
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
5 deletions
+37
-5
contrib/pg_upgrade/pg_upgrade.c
contrib/pg_upgrade/pg_upgrade.c
+6
-0
contrib/pg_upgrade/server.c
contrib/pg_upgrade/server.c
+5
-4
doc/src/sgml/ref/initdb.sgml
doc/src/sgml/ref/initdb.sgml
+11
-0
src/bin/initdb/initdb.c
src/bin/initdb/initdb.c
+15
-1
No files found.
contrib/pg_upgrade/pg_upgrade.c
View file @
cd7569a5
...
...
@@ -150,6 +150,12 @@ main(int argc, char **argv)
new_cluster
.
pgdata
);
check_ok
();
prep_status
(
"Sync data directory to disk"
);
exec_prog
(
UTILITY_LOG_FILE
,
NULL
,
true
,
"
\"
%s/initdb
\"
--sync-only
\"
%s
\"
"
,
new_cluster
.
bindir
,
new_cluster
.
pgdata
);
check_ok
();
create_script_for_cluster_analyze
(
&
analyze_script_file_name
);
create_script_for_old_cluster_deletion
(
&
deletion_script_file_name
);
...
...
contrib/pg_upgrade/server.c
View file @
cd7569a5
...
...
@@ -209,9 +209,9 @@ start_postmaster(ClusterInfo *cluster)
* a gap of 2000000000 from the current xid counter, so autovacuum will
* not touch them.
*
*
synchronous_commit=off improves object creation speed, and we only
*
modify the new cluster, so only use it there. If there is a crash,
*
the new cluster has to be recreated anyway.
*
Turn off durability requirements to improve object creation speed, and
*
we only modify the new cluster, so only use it there. If there is a
*
crash,
the new cluster has to be recreated anyway.
*/
snprintf
(
cmd
,
sizeof
(
cmd
),
"
\"
%s/pg_ctl
\"
-w -l
\"
%s
\"
-D
\"
%s
\"
-o
\"
-p %d%s%s%s%s
\"
start"
,
...
...
@@ -219,7 +219,8 @@ start_postmaster(ClusterInfo *cluster)
(
cluster
->
controldata
.
cat_ver
>=
BINARY_UPGRADE_SERVER_FLAG_CAT_VER
)
?
" -b"
:
" -c autovacuum=off -c autovacuum_freeze_max_age=2000000000"
,
(
cluster
==
&
new_cluster
)
?
" -c synchronous_commit=off"
:
""
,
(
cluster
==
&
new_cluster
)
?
" -c synchronous_commit=off -c fsync=off -c full_page_writes=off"
:
""
,
cluster
->
pgopts
?
cluster
->
pgopts
:
""
,
socket_string
);
/*
...
...
doc/src/sgml/ref/initdb.sgml
View file @
cd7569a5
...
...
@@ -244,6 +244,17 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>-S</option></term>
<term><option>--sync-only</option></term>
<listitem>
<para>
Safely write all database files to disk and exit. This does not
perform any of the normal <application>initdb</> operations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-T <replaceable>CFG</></option></term>
<term><option>--text-search-config=<replaceable>CFG</></option></term>
...
...
src/bin/initdb/initdb.c
View file @
cd7569a5
...
...
@@ -118,6 +118,7 @@ static const char *authmethodlocal = "";
static
bool
debug
=
false
;
static
bool
noclean
=
false
;
static
bool
do_sync
=
true
;
static
bool
sync_only
=
false
;
static
bool
show_setting
=
false
;
static
char
*
xlog_dir
=
""
;
...
...
@@ -2796,6 +2797,7 @@ usage(const char *progname)
printf
(
_
(
" -n, --noclean do not clean up after errors
\n
"
));
printf
(
_
(
" -N, --nosync do not wait for changes to be written safely to disk
\n
"
));
printf
(
_
(
" -s, --show show internal settings
\n
"
));
printf
(
_
(
" -S, --sync-only only sync data directory
\n
"
));
printf
(
_
(
"
\n
Other options:
\n
"
));
printf
(
_
(
" -V, --version output version information, then exit
\n
"
));
printf
(
_
(
" -?, --help show this help, then exit
\n
"
));
...
...
@@ -3445,6 +3447,7 @@ main(int argc, char *argv[])
{
"show"
,
no_argument
,
NULL
,
's'
},
{
"noclean"
,
no_argument
,
NULL
,
'n'
},
{
"nosync"
,
no_argument
,
NULL
,
'N'
},
{
"sync-only"
,
no_argument
,
NULL
,
'S'
},
{
"xlogdir"
,
required_argument
,
NULL
,
'X'
},
{
NULL
,
0
,
NULL
,
0
}
};
...
...
@@ -3476,7 +3479,7 @@ main(int argc, char *argv[])
/* process command-line options */
while
((
c
=
getopt_long
(
argc
,
argv
,
"dD:E:L:nNU:WA:sT:X:"
,
long_options
,
&
option_index
))
!=
-
1
)
while
((
c
=
getopt_long
(
argc
,
argv
,
"dD:E:L:nNU:WA:s
S
T:X:"
,
long_options
,
&
option_index
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -3522,6 +3525,9 @@ main(int argc, char *argv[])
case
'N'
:
do_sync
=
false
;
break
;
case
'S'
:
sync_only
=
true
;
break
;
case
'L'
:
share_path
=
pg_strdup
(
optarg
);
break
;
...
...
@@ -3589,6 +3595,14 @@ main(int argc, char *argv[])
exit
(
1
);
}
/* If we only need to fsync, just to it and exit */
if
(
sync_only
)
{
setup_pgdata
();
perform_fsync
();
return
0
;
}
if
(
pwprompt
&&
pwfilename
)
{
fprintf
(
stderr
,
_
(
"%s: password prompt and password file cannot be specified together
\n
"
),
progname
);
...
...
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