Re: [PATCHES] Proposed patch - psql wraps at window width

2008-04-18 Thread Bryce Nesbitt
Alvaro Herrera wrote: * Don't lose warning comments like this one (unless you've removed the assumption of course) /* * Assumption: This code used only on strings * without multibyte characters, otherwise * this_line-width strlen(this_ptr) and we get * an overflow */ In fact, that

[PATCHES] Coding standards

2008-04-18 Thread Bryce Nesbitt
Alvaro Herrera wrote: People [are] complaining here that we don't teach people here anyway, so hopefully my comments were still useful :-) Yes they are useful. As a new patcher, where should I look for coding standards? How about a little FAQ at the top of the CVS source tree? Though,

Re: [PATCHES] Proposed patch - psql wraps at window width

2008-04-18 Thread Bryce Nesbitt
Peter Eisentraut wrote: Bruce Momjian wrote: I checked the use of COLUMNS and it seems bash updates the environment variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS isn't set. We already had a call in print.c for detecting the number of rows on the screen to

Re: [PATCHES] Coding standards

2008-04-18 Thread Magnus Hagander
Bryce Nesbitt wrote: Alvaro Herrera wrote: People [are] complaining here that we don't teach people here anyway, so hopefully my comments were still useful :-) Yes they are useful. As a new patcher, where should I look for coding standards? How about a little FAQ at the top of the

Re: [PATCHES] Proposed patch - psql wraps at window width

2008-04-18 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Bryce Nesbitt [EMAIL PROTECTED] writes: pre wrap=I checked the use of COLUMNS and it seems bash updates the environment variable when a window is resized. [ Please get rid of the HTML formatting ... ] Bash can update the environment all it wants,

Re: [PATCHES] Proposed patch - psql wraps at window width

2008-04-18 Thread Bryce Nesbitt
Peter Eisentraut wrote: Bruce Momjian wrote: I checked the use of COLUMNS and it seems bash updates the environment variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS isn't set. We already had a call in print.c for detecting the number of rows on the screen to

Re: [PATCHES] Proposed patch - psql wraps at window width

2008-04-18 Thread Gregory Stark
Bryce Nesbitt [EMAIL PROTECTED] writes: I asked the folks over at Experts Exchange to test the behavior of the ioctl I always thought that was a joke domain name, like Pen Island.com. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's PostGIS

Re: [PATCHES] Coding standards

2008-04-18 Thread Alvaro Herrera
Bryce Nesbitt wrote: Alvaro Herrera wrote: People [are] complaining here that we don't teach people here anyway, so hopefully my comments were still useful :-) Yes they are useful. As a new patcher, where should I look for coding standards? How about a little FAQ at the top of the

Re: [PATCHES] Proposed patch - psql wraps at window width

2008-04-18 Thread Joshua D. Drake
On Fri, 18 Apr 2008 17:21:26 +0100 Gregory Stark [EMAIL PROTECTED] wrote: Bryce Nesbitt [EMAIL PROTECTED] writes: I asked the folks over at Experts Exchange to test the behavior of the ioctl I always thought that was a joke domain name, like Pen Island.com. Its not and a lot of

Re: [PATCHES] Coding standards

2008-04-18 Thread Chris Browne
[EMAIL PROTECTED] (Bryce Nesbitt) writes: Alvaro Herrera wrote: People [are] complaining here that we don't teach people here anyway, so hopefully my comments were still useful :-) Yes they are useful. As a new patcher, where should I look for coding standards? How about a little FAQ at

[PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Bruce Momjian
bruce wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: The closest thing I can think of to an automated test is to run repeated sets of the parallel regression tests, and each time SIGTERM a randomly chosen backend at a randomly chosen time. Then see

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Attached is my test script. I ran it for 14 hours (asserts on), running 450 regression tests, with up to seven backends killed per regression test. Hmm, there are something on the order of 1 SQL commands in our regression tests, so even assuming

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Alvaro Herrera
Zoltan Boszormenyi wrote: - float4 conversion is risk free (patch #1) I applied this #1 patch. It needed some further adjustments; in particular contrib/btree_gist regression check was crashing, and utils/fmgr/README needed updating. With contrib/seg also adjusted to use float4 instead of

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Alvaro Herrera
Alvaro Herrera wrote: With contrib/seg also adjusted to use float4 instead of float32, and thus the last usage of float32 gone, I am now wondering if it would be a good idea to remove the float32 and float32data definitions in c.h. Ok, the buildfarm is going yellow over this change. On

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I assume this is just some dumb portability mistake on my part ... or perhaps the fact that the functions are still using v0 fmgr convention? Since they're v0, they'd have to explicitly know about the pass-by-ref status of float4. Did this patch include

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I assume this is just some dumb portability mistake on my part ... or perhaps the fact that the functions are still using v0 fmgr convention? Since they're v0, they'd have to explicitly know about the pass-by-ref status of float4.

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: Since they're v0, they'd have to explicitly know about the pass-by-ref status of float4. Well, the previous code was doing some pallocs, and the new code is not:

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Tom Lane
Tom Lane [EMAIL PROTECTED] writes: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: Since they're v0, they'd have to explicitly know about the pass-by-ref status of float4. Well, the previous code was doing some pallocs, and the new code is not:

Re: [PATCHES] float4/float8/int64 passed by value with tsearch fixup

2008-04-18 Thread Alvaro Herrera
Tom Lane wrote: Specifically, I think what you missed is that on some platforms C functions pass or return float values differently from similar-sized integer or pointer values (typically, the float values get passed in floating-point registers). Argh ... I would have certainly missed that.

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Magnus Hagander
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Attached is my test script. I ran it for 14 hours (asserts on), running 450 regression tests, with up to seven backends killed per regression test. Hmm, there are something on the order of 1 SQL commands in our regression

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Alvaro Herrera
Magnus Hagander wrote: Tom Lane wrote: SLEEP=`expr $RANDOM \* $REGRESSION_DURATION / 32767` Uh, where's the randomness coming from? ... but I should probably wait until that one is answered or fixed, I guess :-) bash. RANDOM Each time this parameter is referenced,

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Attached is my test script. I ran it for 14 hours (asserts on), running 450 regression tests, with up to seven backends killed per regression test. Hmm, there are something on the order of 1 SQL commands in our regression

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Bruce Momjian
Magnus Hagander wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Attached is my test script. I ran it for 14 hours (asserts on), running 450 regression tests, with up to seven backends killed per regression test. Hmm, there are something on the order of 1 SQL

Re: [PATCHES] float4/float8/int64 passed by value with tsearchfixup

2008-04-18 Thread Gregory Stark
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: Specifically, I think what you missed is that on some platforms C functions pass or return float values differently from similar-sized integer or pointer values (typically, the float values get passed in floating-point registers).

Re: [PATCHES] float4/float8/int64 passed by value with tsearchfixup

2008-04-18 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Tom Lane wrote: Specifically, I think what you missed is that on some platforms C functions pass or return float values differently from similar-sized integer or pointer values (typically, the float values get passed in floating-point registers). Hum.

Re: [PATCHES] float4/float8/int64 passed by value with tsearchfixup

2008-04-18 Thread Alvaro Herrera
Tom Lane wrote: Gregory Stark [EMAIL PROTECTED] writes: Tom Lane wrote: Specifically, I think what you missed is that on some platforms C functions pass or return float values differently from similar-sized integer or pointer values (typically, the float values get passed in

Re: [PATCHES] float4/float8/int64 passed by value with tsearchfixup

2008-04-18 Thread Alvaro Herrera
Tom Lane wrote: I was wondering about that too, once it became obvious that (almost?) everything was failing not just some platforms. However, this afternoon's CVS HEAD *does* pass the seg regression test for me on HPPA, and I presume it passed on whatever Alvaro is using (btw, what was

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Bruce Momjian
bruce wrote: Magnus Hagander wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Attached is my test script. I ran it for 14 hours (asserts on), running 450 regression tests, with up to seven backends killed per regression test. Hmm, there are something on the

Re: [PATCHES] Testing pg_terminate_backend()

2008-04-18 Thread Bruce Momjian
bruce wrote: bruce wrote: Magnus Hagander wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Attached is my test script. I ran it for 14 hours (asserts on), running 450 regression tests, with up to seven backends killed per regression test. Hmm,

Re: [PATCHES] float4/float8/int64 passed by value with tsearchfixup

2008-04-18 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: I was wondering about that too, once it became obvious that (almost?) everything was failing not just some platforms. However, this afternoon's CVS HEAD *does* pass the seg regression test for me on HPPA, and I presume it passed on