Re: [HACKERS] Patch to log usage of temporary files

From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Patch to log usage of temporary files
Date: 2007-01-04 14:18:12
Message-ID: 20070104091812.93f3ec7a.wmoran@collaborativefusion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

In response to "Andrew Dunstan" <andrew(at)dunslane(dot)net>:

> Bill Moran wrote:
> > Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> >>
> >> Bill Moran wrote:
> >> > + if (trace_temp_files != -1)
> >> >
> >>
> >> Might be more robust to say
> >>
> >> if (trace_temp_files >= 0)
> >
> > Because it would allow for the easy addition of more negative numbers
> > with magic value?
>
> because ISTM any negative number here should mean no action is to be
> taken. Otherwise how else is it different from 0?

??

I specified in the GUC config that minimum allowable value is -1.

/usr/local/etc/rc.d/postgresql start
FATAL: -5 is outside the valid range for parameter "trace_temp_files" (-1 .. 2147483647)

set trace_temp_files to -8;
ERROR: -8 is outside the valid range for parameter "trace_temp_files" (-1 .. 2147483647)

Perhaps there's another reason to use the >= 0 check, but handling invalid
values with POLA doesn't seem to be a good one.

--
Bill Moran
Collaborative Fusion Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-01-04 14:27:56 wal_checksum = on (default) | off
Previous Message Andrew Dunstan 2007-01-04 14:09:18 Re: 8.3 pending patch queue

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2007-01-04 14:27:56 wal_checksum = on (default) | off
Previous Message Guillaume Smet 2007-01-04 12:58:12 Re: Assorted typos