Re: BUG #4752: sourceline in pg_settings indicates wrong number

Lists: pgsql-bugs
From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4752: sourceline in pg_settings indicates wrong number
Date: 2009-04-09 04:40:03
Message-ID: 200904090440.n394e34s051616@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4752
Logged by: Fujii Masao
Email address: masao(dot)fujii(at)gmail(dot)com
PostgreSQL version: PostgreSQL 8.4d
Operating system: Red Hat Enterprise Linux Server release 5.1 (Tikanga)
Description: sourceline in pg_settings indicates wrong number
Details:

Hi,

sourceline (in pg_settings) of the parameter line without '\n' indicates
wrong number as follows.

$ nl $PGDATA/postgresql.conf
1 shared_buffers = 32MB <-- this line doesn't contain '\n'
$ psql -c "SELECT sourceline FROM pg_settings WHERE name =
'shared_buffers'"
sourceline
------------
0
(1 row)

On the other hand, if the line has '\n', sourceline indicates the correct
number.

$ echo "shared_buffers = 32MB" > $PGDATA/postgresql.conf
$ nl $PGDATA/postgresql.conf
1 shared_buffers = 32MB <-- this line contains '\n'
$ psql -c "SELECT sourceline FROM pg_settings WHERE name =
'shared_buffers'"
sourceline
------------
1
(1 row)

Is this bug?


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4752: sourceline in pg_settings indicates wrong number
Date: 2009-04-09 10:39:58
Message-ID: 3f0b79eb0904090339s28f87612q70f97efeb528d58a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

On Thu, Apr 9, 2009 at 1:40 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> The following bug has been logged online:
>
> Bug reference:      4752
> Logged by:          Fujii Masao
> Email address:      masao(dot)fujii(at)gmail(dot)com
> PostgreSQL version: PostgreSQL 8.4d
> Operating system:   Red Hat Enterprise Linux Server release 5.1 (Tikanga)
> Description:        sourceline in pg_settings indicates wrong number
> Details:
>
> Hi,
>
> sourceline (in pg_settings) of the parameter line without '\n' indicates
> wrong number as follows.
>
>  $ nl $PGDATA/postgresql.conf
>     1  shared_buffers = 32MB         <-- this line doesn't contain '\n'
>  $ psql -c "SELECT sourceline FROM pg_settings WHERE name =
> 'shared_buffers'"
>  sourceline
>  ------------
>           0
>  (1 row)
>
> On the other hand, if the line has '\n', sourceline indicates the correct
> number.
>
>  $ echo "shared_buffers = 32MB" > $PGDATA/postgresql.conf
>  $ nl $PGDATA/postgresql.conf
>     1  shared_buffers = 32MB         <-- this line contains '\n'
>  $ psql -c "SELECT sourceline FROM pg_settings WHERE name =
> 'shared_buffers'"
>   sourceline
>  ------------
>           1
>  (1 row)
>
> Is this bug?

Attached patch fixes the bug. Is this worth committing?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
sourceline_0409.patch text/x-patch 2.1 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4752: sourceline in pg_settings indicates wrong number
Date: 2009-04-09 14:22:56
Message-ID: 13580.1239286976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> Attached patch fixes the bug. Is this worth committing?

Applied to HEAD, but it didn't seem worth back-patching. Thanks.

regards, tom lane

PS: when you generate a diff against a non-clean source tree, please
remove the cruft like

> ? GNUmakefile
> ? config.log
> ? config.status

from the posted patch. It's useless and annoys readers ...


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4752: sourceline in pg_settings indicates wrong number
Date: 2009-04-10 00:45:05
Message-ID: 3f0b79eb0904091745x3e66f9a8ye01b3c27c3ee061d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

On Thu, Apr 9, 2009 at 11:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>> Attached patch fixes the bug. Is this worth committing?
>
> Applied to HEAD, but it didn't seem worth back-patching.  Thanks.

Thanks.

> PS: when you generate a diff against a non-clean source tree, please
> remove the cruft like
>
>> ? GNUmakefile
>> ? config.log
>> ? config.status
>
> from the posted patch.  It's useless and annoys readers ...

Oh, sorry. I will be careful about it.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center