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
d6b57925
Commit
d6b57925
authored
Mar 15, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GUC log_statement, log_pid, log_timestamp, log_source_port.
Functionality superceeded by log_line_prefix. Andrew Dunstan
parent
6812e95a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
140 deletions
+22
-140
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+7
-39
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+7
-13
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+2
-6
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+3
-48
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+1
-26
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/misc/postgresql.conf.sample
+0
-3
src/include/tcop/tcopprot.h
src/include/tcop/tcopprot.h
+1
-2
src/include/utils/elog.h
src/include/utils/elog.h
+1
-3
No files found.
doc/src/sgml/runtime.sgml
View file @
d6b57925
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.2
49 2004/03/12 00:56:00 neilc
Exp $
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.2
50 2004/03/15 15:56:21 momjian
Exp $
-->
-->
<Chapter Id="runtime">
<Chapter Id="runtime">
...
@@ -1994,7 +1994,8 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -1994,7 +1994,8 @@ SET ENABLE_SEQSCAN TO OFF;
<para>
<para>
Causes the duration of every completed statement to be logged.
Causes the duration of every completed statement to be logged.
To use this option, it is recommended that you also enable
To use this option, it is recommended that you also enable
<varname>log_statement</> and <varname>log_pid</> so that you
<varname>log_statement</> and if not using <application>syslog</>
log the PID using <varname>log_line_prefix</> so that you
can link the statement to the duration using the process
can link the statement to the duration using the process
ID. The default is off. Only superusers can turn off this
ID. The default is off. Only superusers can turn off this
option if it is enabled by the administrator.
option if it is enabled by the administrator.
...
@@ -2015,6 +2016,8 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -2015,6 +2016,8 @@ SET ENABLE_SEQSCAN TO OFF;
processes without controlling sessions. <application>Syslog</> produces its own
processes without controlling sessions. <application>Syslog</> produces its own
timestamp and process ID information, so you probably do not want to
timestamp and process ID information, so you probably do not want to
use those escapes if you are using <application>syslog</>.
use those escapes if you are using <application>syslog</>.
This option can only be set at server start or in the
<filename>postgresql.conf</filename> configuration file.
<informaltable>
<informaltable>
<tgroup cols="3">
<tgroup cols="3">
<thead>
<thead>
...
@@ -2059,7 +2062,8 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -2059,7 +2062,8 @@ SET ENABLE_SEQSCAN TO OFF;
<row>
<row>
<entry><literal>%c</literal></entry>
<entry><literal>%c</literal></entry>
<entry>Session ID. A unique identifier for each session.
<entry>Session ID. A unique identifier for each session.
It is 2 4-byte hexadecimal numbers separated by a dot. The numbers
It is 2 4-byte hexadecimal numbers (without leading zeros)
separated by a dot. The numbers
are the Session Start Time and the Process ID, so this can also
are the Session Start Time and the Process ID, so this can also
be used as a space saving way of printing these items.</entry>
be used as a space saving way of printing these items.</entry>
<entry>Yes</entry>
<entry>Yes</entry>
...
@@ -2094,19 +2098,6 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -2094,19 +2098,6 @@ SET ENABLE_SEQSCAN TO OFF;
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term><varname>log_pid</varname> (<type>boolean</type>)</term>
<listitem>
<para>
Prefixes each message in the server log file with the process ID of
the server process. This is useful to sort out which messages
pertain to which connection. The default is off. This parameter
does not affect messages logged via <application>syslog</>, which
always contain the process ID.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-log-statement" xreflabel="log_statement">
<varlistentry id="guc-log-statement" xreflabel="log_statement">
<term><varname>log_statement</varname> (<type>boolean</type>)</term>
<term><varname>log_statement</varname> (<type>boolean</type>)</term>
<listitem>
<listitem>
...
@@ -2121,16 +2112,6 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -2121,16 +2112,6 @@ SET ENABLE_SEQSCAN TO OFF;
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry id="guc-log-timestamp" xreflabel="log_timestamp">
<term><varname>log_timestamp</varname> (<type>boolean</type>)</term>
<listitem>
<para>
Prefixes each server log message with a time stamp. The default
is off.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-log-hostname" xreflabel="log_hostname">
<varlistentry id="guc-log-hostname" xreflabel="log_hostname">
<term><varname>log_hostname</varname> (<type>boolean</type>)</term>
<term><varname>log_hostname</varname> (<type>boolean</type>)</term>
<listitem>
<listitem>
...
@@ -2144,19 +2125,6 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -2144,19 +2125,6 @@ SET ENABLE_SEQSCAN TO OFF;
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry id="guc-log-source-port" xreflabel="log_source_port">
<term><varname>log_source_port</varname> (<type>boolean</type>)</term>
<listitem>
<para>
Shows the outgoing port number of the connecting host in the
connection log messages. You could trace back the port number
to find out what user initiated the connection. Other than
that, it's pretty useless and therefore off by default. This
option can only be set at server start.
</para>
</listitem>
</varlistentry>
</variablelist>
</variablelist>
</sect3>
</sect3>
</sect2>
</sect2>
...
...
src/backend/postmaster/postmaster.c
View file @
d6b57925
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.37
3 2004/03/10 21:12:46
momjian Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.37
4 2004/03/15 15:56:21
momjian Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -212,8 +212,7 @@ int CheckPointTimeout = 300;
...
@@ -212,8 +212,7 @@ int CheckPointTimeout = 300;
int
CheckPointWarning
=
30
;
int
CheckPointWarning
=
30
;
time_t
LastSignalledCheckpoint
=
0
;
time_t
LastSignalledCheckpoint
=
0
;
bool
log_hostname
;
/* for ps display */
bool
log_hostname
;
/* for ps display and logging */
bool
LogSourcePort
;
bool
Log_connections
=
false
;
bool
Log_connections
=
false
;
bool
Db_user_namespace
=
false
;
bool
Db_user_namespace
=
false
;
...
@@ -2414,6 +2413,7 @@ BackendInit(Port *port)
...
@@ -2414,6 +2413,7 @@ BackendInit(Port *port)
struct
timezone
tz
;
struct
timezone
tz
;
char
remote_host
[
NI_MAXHOST
];
char
remote_host
[
NI_MAXHOST
];
char
remote_port
[
NI_MAXSERV
];
char
remote_port
[
NI_MAXSERV
];
char
remote_ps_data
[
NI_MAXHOST
];
IsUnderPostmaster
=
true
;
/* we are a postmaster subprocess now */
IsUnderPostmaster
=
true
;
/* we are a postmaster subprocess now */
...
@@ -2474,21 +2474,15 @@ BackendInit(Port *port)
...
@@ -2474,21 +2474,15 @@ BackendInit(Port *port)
remote_port
,
sizeof
(
remote_port
),
remote_port
,
sizeof
(
remote_port
),
NI_NUMERICHOST
|
NI_NUMERICSERV
);
NI_NUMERICHOST
|
NI_NUMERICSERV
);
}
}
snprintf
(
remote_ps_data
,
sizeof
(
remote_ps_data
),
remote_port
[
0
]
==
'\0'
?
"%s"
:
"%s(%s)"
,
remote_host
,
remote_port
);
if
(
Log_connections
)
if
(
Log_connections
)
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"connection received: host=%s port=%s"
,
(
errmsg
(
"connection received: host=%s port=%s"
,
remote_host
,
remote_port
)));
remote_host
,
remote_port
)));
if
(
LogSourcePort
)
{
/* modify remote_host for use in ps status */
char
tmphost
[
NI_MAXHOST
];
snprintf
(
tmphost
,
sizeof
(
tmphost
),
"%s(%s)"
,
remote_host
,
remote_port
);
StrNCpy
(
remote_host
,
tmphost
,
sizeof
(
remote_host
));
}
/*
/*
* save remote_host and remote_port in port stucture
* save remote_host and remote_port in port stucture
*/
*/
...
@@ -2517,7 +2511,7 @@ BackendInit(Port *port)
...
@@ -2517,7 +2511,7 @@ BackendInit(Port *port)
* title for ps. It's good to do this as early as possible in
* title for ps. It's good to do this as early as possible in
* startup.
* startup.
*/
*/
init_ps_display
(
port
->
user_name
,
port
->
database_name
,
remote_
host
);
init_ps_display
(
port
->
user_name
,
port
->
database_name
,
remote_
ps_data
);
set_ps_display
(
"authentication"
);
set_ps_display
(
"authentication"
);
/*
/*
...
...
src/backend/tcop/postgres.c
View file @
d6b57925
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.39
4 2004/03/09 04:43:07
momjian Exp $
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.39
5 2004/03/15 15:56:22
momjian Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -3212,11 +3212,7 @@ log_disconnections(int code, Datum arg)
...
@@ -3212,11 +3212,7 @@ log_disconnections(int code, Datum arg)
snprintf
(
dbname
,
sizeof
(
dbname
),
" database=%s"
,
port
->
database_name
);
snprintf
(
dbname
,
sizeof
(
dbname
),
" database=%s"
,
port
->
database_name
);
snprintf
(
remote_host
,
sizeof
(
remote_host
),
" host=%s"
,
snprintf
(
remote_host
,
sizeof
(
remote_host
),
" host=%s"
,
port
->
remote_host
);
port
->
remote_host
);
/* prevent redundant or empty reporting of port */
if
(
!
LogSourcePort
&&
strlen
(
port
->
remote_port
))
snprintf
(
remote_port
,
sizeof
(
remote_port
),
" port=%s"
,
port
->
remote_port
);
snprintf
(
remote_port
,
sizeof
(
remote_port
),
" port=%s"
,
port
->
remote_port
);
else
remote_port
[
0
]
=
'\0'
;
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
...
...
src/backend/utils/error/elog.c
View file @
d6b57925
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.12
7 2004/03/09 04:43:07
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.12
8 2004/03/15 15:56:23
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -69,9 +69,6 @@ ErrorContextCallback *error_context_stack = NULL;
...
@@ -69,9 +69,6 @@ ErrorContextCallback *error_context_stack = NULL;
/* GUC parameters */
/* GUC parameters */
PGErrorVerbosity
Log_error_verbosity
=
PGERROR_VERBOSE
;
PGErrorVerbosity
Log_error_verbosity
=
PGERROR_VERBOSE
;
bool
Log_timestamp
=
false
;
/* show timestamps in stderr
* output */
bool
Log_pid
=
false
;
/* show PIDs in stderr output */
char
*
Log_line_prefix
=
""
;
/* format for extra log line info */
char
*
Log_line_prefix
=
""
;
/* format for extra log line info */
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
...
@@ -144,8 +141,6 @@ static void send_message_to_frontend(ErrorData *edata);
...
@@ -144,8 +141,6 @@ static void send_message_to_frontend(ErrorData *edata);
static
char
*
expand_fmt_string
(
const
char
*
fmt
,
ErrorData
*
edata
);
static
char
*
expand_fmt_string
(
const
char
*
fmt
,
ErrorData
*
edata
);
static
const
char
*
useful_strerror
(
int
errnum
);
static
const
char
*
useful_strerror
(
int
errnum
);
static
const
char
*
error_severity
(
int
elevel
);
static
const
char
*
error_severity
(
int
elevel
);
static
const
char
*
print_timestamp
(
void
);
static
const
char
*
print_pid
(
void
);
static
void
append_with_tabs
(
StringInfo
buf
,
const
char
*
str
);
static
void
append_with_tabs
(
StringInfo
buf
,
const
char
*
str
);
static
const
char
*
log_line_prefix
(
void
);
static
const
char
*
log_line_prefix
(
void
);
...
@@ -1134,7 +1129,7 @@ log_line_prefix(void)
...
@@ -1134,7 +1129,7 @@ log_line_prefix(void)
case
'r'
:
case
'r'
:
j
+=
snprintf
(
result
+
j
,
result_len
-
j
,
"%s"
,
j
+=
snprintf
(
result
+
j
,
result_len
-
j
,
"%s"
,
MyProcPort
->
remote_host
);
MyProcPort
->
remote_host
);
if
(
!
LogSourcePort
&&
strlen
(
MyProcPort
->
remote_port
)
)
if
(
strlen
(
MyProcPort
->
remote_port
)
>
0
)
j
+=
snprintf
(
result
+
j
,
result_len
-
j
,
"(%s)"
,
j
+=
snprintf
(
result
+
j
,
result_len
-
j
,
"(%s)"
,
MyProcPort
->
remote_port
);
MyProcPort
->
remote_port
);
break
;
break
;
...
@@ -1293,10 +1288,7 @@ send_message_to_server_log(ErrorData *edata)
...
@@ -1293,10 +1288,7 @@ send_message_to_server_log(ErrorData *edata)
* Timestamp and PID are only used for stderr output --- we assume
* Timestamp and PID are only used for stderr output --- we assume
* the syslog daemon will supply them for us in the other case.
* the syslog daemon will supply them for us in the other case.
*/
*/
fprintf
(
stderr
,
"%s%s%s"
,
fprintf
(
stderr
,
"%s"
,
buf
.
data
);
Log_timestamp
?
print_timestamp
()
:
""
,
Log_pid
?
print_pid
()
:
""
,
buf
.
data
);
}
}
pfree
(
buf
.
data
);
pfree
(
buf
.
data
);
...
@@ -1568,43 +1560,6 @@ error_severity(int elevel)
...
@@ -1568,43 +1560,6 @@ error_severity(int elevel)
}
}
/*
* Return a timestamp string like
*
* "2000-06-04 13:12:03 "
*/
static
const
char
*
print_timestamp
(
void
)
{
time_t
curtime
;
static
char
buf
[
21
];
/* format `YYYY-MM-DD HH:MM:SS ' */
curtime
=
time
(
NULL
);
strftime
(
buf
,
sizeof
(
buf
),
"%Y-%m-%d %H:%M:%S "
,
localtime
(
&
curtime
));
return
buf
;
}
/*
* Return a string like
*
* "[123456] "
*
* with the current pid.
*/
static
const
char
*
print_pid
(
void
)
{
static
char
buf
[
10
];
/* allow `[123456] ' */
snprintf
(
buf
,
sizeof
(
buf
),
"[%d] "
,
(
int
)
MyProcPid
);
return
buf
;
}
/*
/*
* append_with_tabs
* append_with_tabs
*
*
...
...
src/backend/utils/misc/guc.c
View file @
d6b57925
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.1
89 2004/03/09 04:43:07
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.1
90 2004/03/15 15:56:24
momjian Exp $
*
*
*--------------------------------------------------------------------
*--------------------------------------------------------------------
*/
*/
...
@@ -508,22 +508,6 @@ static struct config_bool ConfigureNamesBool[] =
...
@@ -508,22 +508,6 @@ static struct config_bool ConfigureNamesBool[] =
&
Log_disconnections
,
&
Log_disconnections
,
false
,
NULL
,
NULL
false
,
NULL
,
NULL
},
},
{
{
"log_timestamp"
,
PGC_SIGHUP
,
LOGGING_WHAT
,
gettext_noop
(
"Prefixes server log messages with a time stamp."
),
NULL
},
&
Log_timestamp
,
false
,
NULL
,
NULL
},
{
{
"log_pid"
,
PGC_SIGHUP
,
LOGGING_WHAT
,
gettext_noop
(
"Prefixes server log messages with the server PID."
),
NULL
},
&
Log_pid
,
false
,
NULL
,
NULL
},
#ifdef USE_ASSERT_CHECKING
#ifdef USE_ASSERT_CHECKING
{
{
...
@@ -750,15 +734,6 @@ static struct config_bool ConfigureNamesBool[] =
...
@@ -750,15 +734,6 @@ static struct config_bool ConfigureNamesBool[] =
&
log_hostname
,
&
log_hostname
,
false
,
NULL
,
NULL
false
,
NULL
,
NULL
},
},
{
{
"log_source_port"
,
PGC_SIGHUP
,
LOGGING_WHAT
,
gettext_noop
(
"Logs the outgoing port number of the connecting host."
),
NULL
},
&
LogSourcePort
,
false
,
NULL
,
NULL
},
{
{
{
"sql_inheritance"
,
PGC_USERSET
,
COMPAT_OPTIONS_PREVIOUS
,
{
"sql_inheritance"
,
PGC_USERSET
,
COMPAT_OPTIONS_PREVIOUS
,
gettext_noop
(
"Causes subtables to be included by default in various commands."
),
gettext_noop
(
"Causes subtables to be included by default in various commands."
),
...
...
src/backend/utils/misc/postgresql.conf.sample
View file @
d6b57925
...
@@ -184,7 +184,6 @@
...
@@ -184,7 +184,6 @@
#log_connections = false
#log_connections = false
#log_disconnections = false
#log_disconnections = false
#log_duration = false
#log_duration = false
#log_pid = false
#log_line_prefix = '' # e.g. '<%u%%%d> '
#log_line_prefix = '' # e.g. '<%u%%%d> '
# %u=user name %d=database name
# %u=user name %d=database name
# %r=remote host and port
# %r=remote host and port
...
@@ -194,9 +193,7 @@
...
@@ -194,9 +193,7 @@
# %x=stop here in non-session processes
# %x=stop here in non-session processes
# %%='%'
# %%='%'
#log_statement = false
#log_statement = false
#log_timestamp = false
#log_hostname = false
#log_hostname = false
#log_source_port = false
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
...
...
src/include/tcop/tcopprot.h
View file @
d6b57925
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,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
*
*
* $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.6
1 2003/11/29 22:41:14 pgsql
Exp $
* $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.6
2 2004/03/15 15:56:27 momjian
Exp $
*
*
* OLD COMMENTS
* OLD COMMENTS
* This file was created so that other c files could get the two
* This file was created so that other c files could get the two
...
@@ -30,7 +30,6 @@ extern bool Warn_restart_ready;
...
@@ -30,7 +30,6 @@ extern bool Warn_restart_ready;
extern
bool
InError
;
extern
bool
InError
;
extern
CommandDest
whereToSendOutput
;
extern
CommandDest
whereToSendOutput
;
extern
bool
log_hostname
;
extern
bool
log_hostname
;
extern
bool
LogSourcePort
;
extern
DLLIMPORT
const
char
*
debug_query_string
;
extern
DLLIMPORT
const
char
*
debug_query_string
;
extern
char
*
rendezvous_name
;
extern
char
*
rendezvous_name
;
...
...
src/include/utils/elog.h
View file @
d6b57925
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,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
*
*
* $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.6
5 2004/03/09 04:43:07
momjian Exp $
* $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.6
6 2004/03/15 15:56:28
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -169,8 +169,6 @@ typedef enum
...
@@ -169,8 +169,6 @@ typedef enum
}
PGErrorVerbosity
;
}
PGErrorVerbosity
;
extern
PGErrorVerbosity
Log_error_verbosity
;
extern
PGErrorVerbosity
Log_error_verbosity
;
extern
bool
Log_timestamp
;
extern
bool
Log_pid
;
extern
char
*
Log_line_prefix
;
extern
char
*
Log_line_prefix
;
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
...
...
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