Thread: Bug#98565: postgresql logs notices with GMT timestamps in syslog (fwd)

Bug#98565: postgresql logs notices with GMT timestamps in syslog (fwd)

From
"Oliver Elphick"
Date:
I can't see any reason in the code why this should be happening.

------- Forwarded Message

Date:    Thu, 24 May 2001 00:25:32 -0400
From:    Marc Sherman <msherman@projectile.ca>
To:      Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#98565: postgresql logs notices with GMT timestamps in syslog

Package: postgresql
Version: 7.1.1-3
Severity: normal

Notices are being timestamped in GMT in the syslog, instead of local
time like all other log entries.  Here's a fragment from my syslog:

May 23 23:17:30 projectile postgres[1035]: [1] DEBUG:  connection: host=[local]
user=www-data database=inwopc
May 24 03:17:30 projectile postgres[1035]: [2] NOTICE:  Adding missing FROM-cla
u
se entry for table "games"
May 23 23:17:30 projectile apache: NOTICE:  Adding missing FROM-clause entry fo
rtable "games"

All three entries are from the same connection.  The second entry is
the notice being logged by postgres, while the third entry (with the
local timestamp) is that same notice being logged by apache (php).

- - Marc

- -- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux projectile 2.2.19 #1 Mon May 7 09:24:37 EDT 2001 i586

Versions of packages postgresql depends on:
ii  debconf                       0.9.41     Debian configuration management sy
ii  debianutils                   1.15       Miscellaneous utilities specific t
ii  libc6                         2.2.3-1    GNU C Library: Shared libraries an
ii  libpgsql2.1                   7.1.1-3    Shared library libpq.so.2.1 for Po
ii  libreadline4                  4.2-3      GNU readline and history libraries
ii  libssl0.9.6                   0.9.6-2    SSL shared libraries              
ii  postgresql-client             7.1.1-3    Front-end programs for PostgreSQL 
ii  procps                        1:2.0.7-4  The /proc file system utilities.  
ii  zlib1g                        1:1.1.3-15 compression library - runtime     


------- End of Forwarded Message


-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "I will praise thee; for I am fearfully and wonderfully      made..."
Psalms139:14 
 




"Oliver Elphick" <olly@lfix.co.uk> writes:
> Notices are being timestamped in GMT in the syslog, instead of local
> time like all other log entries.  Here's a fragment from my syslog:

Curious.  I always assumed that syslog timestamps were supplied by the
syslog daemon, but to make this happen they'd have to be supplied in the
syslog client process (viz. the Postgres process).  What timezone is the
Postgres backend being run in, and is it different from all the other
syslog clients on the system?
        regards, tom lane


Re: Bug#98565: postgresql logs notices with GMT timestamps in syslog (fwd)

From
"Oliver Elphick"
Date:
Tom Lane wrote: >"Oliver Elphick" <olly@lfix.co.uk> writes: >> Notices are being timestamped in GMT in the syslog,
insteadof local >> time like all other log entries.  Here's a fragment from my syslog: > >Curious.  I always assumed
thatsyslog timestamps were supplied by the >syslog daemon, but to make this happen they'd have to be supplied in the
>syslogclient process (viz. the Postgres process).  What timezone is the >Postgres backend being run in, and is it
differentfrom all the other >syslog clients on the system?
 

I just got this extra information from the reporter.

------- Forwarded Message

Date:    Thu, 24 May 2001 08:57:49 -0400
From:    "Marc Sherman" <msherman@projectile.ca>
To:      <98565@bugs.debian.org>
Subject: Bug#98565: More info on this bug

The connection that is creating this NOTICE is executing
"set time zone 'GMT';" immediately after connection; I
suspect that what's happening is that postmaster is setting the
libc timezone (by changing the environment and calling tzset)
when is executes that query, causing subsequent system calls
(including syslog) to use the new timezone.

- - Marc



------- End of Forwarded Message


-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "I will praise thee; for I am fearfully and wonderfully      made..."
Psalms139:14 
 




Re: Bug#98565: postgresql logs notices with GMT timestamps in syslog (fwd)

From
Ian Lance Taylor
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> "Oliver Elphick" <olly@lfix.co.uk> writes:
> > Notices are being timestamped in GMT in the syslog, instead of local
> > time like all other log entries.  Here's a fragment from my syslog:
> 
> Curious.  I always assumed that syslog timestamps were supplied by the
> syslog daemon, but to make this happen they'd have to be supplied in the
> syslog client process (viz. the Postgres process).

That is correct.  The syslog(3) function puts a timestamp in front of
the message, and writes it to the syslog daemon.  The string written
to the daemon starts with <N>, where N is the priority and facility
or'ed together.

Ian


"Oliver Elphick" <olly@lfix.co.uk> writes:
> I just got this extra information from the reporter.

> The connection that is creating this NOTICE is executing
> "set time zone 'GMT';" immediately after connection; I
> suspect that what's happening is that postmaster is setting the
> libc timezone (by changing the environment and calling tzset)
> when is executes that query, causing subsequent system calls
> (including syslog) to use the new timezone.

Uh-huh.  This is not a bug, or at least it's not our bug.
        regards, tom lane