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
7c619be6
Commit
7c619be6
authored
Jan 27, 2014
by
Fujii Masao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typos in comments for ALTER SYSTEM.
Michael Paquier
parent
152d24f5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
20 deletions
+19
-20
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc-file.l
+1
-1
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+15
-16
src/bin/initdb/initdb.c
src/bin/initdb/initdb.c
+2
-2
src/include/pg_config_manual.h
src/include/pg_config_manual.h
+1
-1
No files found.
src/backend/utils/misc/guc-file.l
View file @
7c619be6
...
@@ -149,7 +149,7 @@ ProcessConfigFile(GucContext context)
...
@@ -149,7 +149,7 @@ ProcessConfigFile(GucContext context)
}
}
/*
/*
* Parse
postgresql.auto.conf file
after postgresql.conf to replace
* Parse
file PG_AUTOCONF_FILENAME
after postgresql.conf to replace
* parameters set by ALTER SYSTEM command. This file is present in
* parameters set by ALTER SYSTEM command. This file is present in
* data directory, however when called during initdb data directory is not
* data directory, however when called during initdb data directory is not
* set till this point, so use ConfigFile path which will be same.
* set till this point, so use ConfigFile path which will be same.
...
...
src/backend/utils/misc/guc.c
View file @
7c619be6
...
@@ -6457,9 +6457,9 @@ flatten_set_variable_args(const char *name, List *args)
...
@@ -6457,9 +6457,9 @@ flatten_set_variable_args(const char *name, List *args)
}
}
/*
/*
* Write
s updated configuration parameter values into
* Write
updated configuration parameter values into a temporary file.
*
postgresql.auto.conf.temp file. It traverses the list of parameters
*
This function traverses the list of parameters and quotes the string
*
and quote the string values before writing them to temporaray file
.
*
values before writing them
.
*/
*/
static
void
static
void
write_auto_conf_file
(
int
fd
,
const
char
*
filename
,
ConfigVariable
**
head_p
)
write_auto_conf_file
(
int
fd
,
const
char
*
filename
,
ConfigVariable
**
head_p
)
...
@@ -6468,8 +6468,8 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
...
@@ -6468,8 +6468,8 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
StringInfoData
buf
;
StringInfoData
buf
;
initStringInfo
(
&
buf
);
initStringInfo
(
&
buf
);
appendStringInfoString
(
&
buf
,
"# Do not edit this file manually!
\n
"
);
appendStringInfoString
(
&
buf
,
"# Do not edit this file manually!
\n
"
);
appendStringInfoString
(
&
buf
,
"# It will be overwritten by ALTER SYSTEM command.
\n
"
);
appendStringInfoString
(
&
buf
,
"# It will be overwritten by ALTER SYSTEM command.
\n
"
);
/*
/*
* write the file header message before contents, so that if there is no
* write the file header message before contents, so that if there is no
...
@@ -6517,7 +6517,7 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
...
@@ -6517,7 +6517,7 @@ write_auto_conf_file(int fd, const char *filename, ConfigVariable **head_p)
/*
/*
* This function takes list of all configuration parameters in
* This function takes list of all configuration parameters in
*
postgresql.auto.conf
and parameter to be updated as input arguments and
*
PG_AUTOCONF_FILENAME
and parameter to be updated as input arguments and
* replace the updated configuration parameter value in a list. If the
* replace the updated configuration parameter value in a list. If the
* parameter to be updated is new then it is appended to the list of
* parameter to be updated is new then it is appended to the list of
* parameters.
* parameters.
...
@@ -6595,13 +6595,12 @@ replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
...
@@ -6595,13 +6595,12 @@ replace_auto_config_value(ConfigVariable **head_p, ConfigVariable **tail_p,
* and write them all to the automatic configuration file.
* and write them all to the automatic configuration file.
*
*
* The configuration parameters are written to a temporary
* The configuration parameters are written to a temporary
* file then renamed to the final name. The template for the
* file then renamed to the final name.
* temporary file is postgresql.auto.conf.temp.
*
*
* An LWLock is used to serialize writing to the same file.
* An LWLock is used to serialize writing to the same file.
*
*
* In case of an error, we leave the original automatic
* In case of an error, we leave the original automatic
* configuration file (
postgresql.auto.conf
) intact.
* configuration file (
PG_AUTOCONF_FILENAME
) intact.
*/
*/
void
void
AlterSystemSetConfigFile
(
AlterSystemStmt
*
altersysstmt
)
AlterSystemSetConfigFile
(
AlterSystemStmt
*
altersysstmt
)
...
@@ -6664,8 +6663,8 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
...
@@ -6664,8 +6663,8 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
/*
/*
* Use data directory as reference path for
postgresql.auto.conf and it'
s
* Use data directory as reference path for
PG_AUTOCONF_FILENAME and it
s
* corresponding temp
file
* corresponding temp
orary file.
*/
*/
join_path_components
(
AutoConfFileName
,
data_directory
,
PG_AUTOCONF_FILENAME
);
join_path_components
(
AutoConfFileName
,
data_directory
,
PG_AUTOCONF_FILENAME
);
canonicalize_path
(
AutoConfFileName
);
canonicalize_path
(
AutoConfFileName
);
...
@@ -6674,10 +6673,10 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
...
@@ -6674,10 +6673,10 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
"temp"
);
"temp"
);
/*
/*
*
one backend is allowed to operate on postgresql.auto.conf file
, to
*
One backend is allowed to operate on file PG_AUTOCONF_FILENAME
, to
* ensure that we need to update the contents of the file with
* ensure that we need to update the contents of the file with
* AutoFileLock. To ensure crash safety, first the contents are written to
* AutoFileLock. To ensure crash safety, first the contents are written to
*
temporary file and then rename it to postgresql.auto.conf
. In case
*
a temporary file which is then renameed to PG_AUTOCONF_FILENAME
. In case
* there exists a temp file from previous crash, that can be reused.
* there exists a temp file from previous crash, that can be reused.
*/
*/
...
@@ -6694,14 +6693,14 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
...
@@ -6694,14 +6693,14 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
{
{
if
(
stat
(
AutoConfFileName
,
&
st
)
==
0
)
if
(
stat
(
AutoConfFileName
,
&
st
)
==
0
)
{
{
/* open
postgresql.auto.conf file
*/
/* open
file PG_AUTOCONF_FILENAME
*/
infile
=
AllocateFile
(
AutoConfFileName
,
"r"
);
infile
=
AllocateFile
(
AutoConfFileName
,
"r"
);
if
(
infile
==
NULL
)
if
(
infile
==
NULL
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"failed to open auto conf file
\"
%s
\"
: %m "
,
(
errmsg
(
"failed to open auto conf file
\"
%s
\"
: %m "
,
AutoConfFileName
)));
AutoConfFileName
)));
/*
Parse the postgresql.auto.conf file
*/
/*
parse it
*/
ParseConfigFp
(
infile
,
AutoConfFileName
,
0
,
LOG
,
&
head
,
&
tail
);
ParseConfigFp
(
infile
,
AutoConfFileName
,
0
,
LOG
,
&
head
,
&
tail
);
FreeFile
(
infile
);
FreeFile
(
infile
);
...
@@ -6713,7 +6712,7 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
...
@@ -6713,7 +6712,7 @@ AlterSystemSetConfigFile(AlterSystemStmt * altersysstmt)
*/
*/
replace_auto_config_value
(
&
head
,
&
tail
,
AutoConfFileName
,
name
,
value
);
replace_auto_config_value
(
&
head
,
&
tail
,
AutoConfFileName
,
name
,
value
);
/* Write and sync the
New contents to postgresql.auto.conf.temp
file */
/* Write and sync the
new contents to the temporary
file */
write_auto_conf_file
(
Tmpfd
,
AutoConfTmpFileName
,
&
head
);
write_auto_conf_file
(
Tmpfd
,
AutoConfTmpFileName
,
&
head
);
close
(
Tmpfd
);
close
(
Tmpfd
);
...
...
src/bin/initdb/initdb.c
View file @
7c619be6
...
@@ -1300,8 +1300,8 @@ setup_config(void)
...
@@ -1300,8 +1300,8 @@ setup_config(void)
* file will override the value of parameters that exists before parse of
* file will override the value of parameters that exists before parse of
* this file.
* this file.
*/
*/
autoconflines
[
0
]
=
pg_strdup
(
"# Do not edit this file manually!
\n
"
);
autoconflines
[
0
]
=
pg_strdup
(
"# Do not edit this file manually!
\n
"
);
autoconflines
[
1
]
=
pg_strdup
(
"# It will be overwritten by the ALTER SYSTEM command.
\n
"
);
autoconflines
[
1
]
=
pg_strdup
(
"# It will be overwritten by the ALTER SYSTEM command.
\n
"
);
autoconflines
[
2
]
=
NULL
;
autoconflines
[
2
]
=
NULL
;
sprintf
(
path
,
"%s/%s"
,
pg_data
,
PG_AUTOCONF_FILENAME
);
sprintf
(
path
,
"%s/%s"
,
pg_data
,
PG_AUTOCONF_FILENAME
);
...
...
src/include/pg_config_manual.h
View file @
7c619be6
...
@@ -304,6 +304,6 @@
...
@@ -304,6 +304,6 @@
/*
/*
* Automatic configuration file name for ALTER SYSTEM.
* Automatic configuration file name for ALTER SYSTEM.
* This file will be used to store values of configuration parameters
* This file will be used to store values of configuration parameters
* set by ALTER SYSTEM command
* set by ALTER SYSTEM command
.
*/
*/
#define PG_AUTOCONF_FILENAME "postgresql.auto.conf"
#define PG_AUTOCONF_FILENAME "postgresql.auto.conf"
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