Re: [PATCHES] [HACKERS] random_fract and aix compiler bug

2003-10-17 Thread Zeugswetter Andreas SB SD
> > Would we be happy with the following, which would work ? > > } while (z <= 0 || z == MAX_RANDOM_VALUE); > > I suppose this doesn't? > } while (z <= 0 || z >= MAX_RANDOM_VALUE); Ah, yes ! That also works and is a lot nicer. Can you please apply ? Together with the patch in

Re: [PATCHES] fix memory leak in libpq

2003-10-17 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > This patch fixes a small memory leak in libpq: the 'pstatus' field of > PGconn is a linked list of malloc'ed nodes, so it should be freed on > PQfinish(). Arghh! Can't believe I forgot to do that. Patch applied --- many thanks. r

Re: [PATCHES] [HACKERS] random_fract and aix compiler bug

2003-10-17 Thread Tom Lane
"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes: > Would we be happy with the following, which would work ? > } while (z <= 0 || z == MAX_RANDOM_VALUE); I suppose this doesn't? } while (z <= 0 || z >= MAX_RANDOM_VALUE); regards, tom lane -

[PATCHES] minor psql cleanup

2003-10-17 Thread Neil Conway
This patch reduces some unsightly #ifdefs, and fixes two typos in comments in the psql code. This doesn't make any functional change, so feel free to save it for 7.5 -Neil Index: src/bin/psql/command.c === RCS file: /var/lib/cvs/pgsq

Re: [PATCHES] [HACKERS] random_fract and aix compiler bug

2003-10-17 Thread Zeugswetter Andreas SB SD
> ! } while (!(z > 0 && z < MAX_RANDOM_VALUE)); > > ! } while (z == 0 || z == MAX_RANDOM_VALUE); > > This seems fairly ugly, since it eliminates the original coding's > positive guarantee that the final result is in 0 < x < 1. Does your yes, ugly :-( > compiler manage not to choke if

[PATCHES] fix memory leak in libpq

2003-10-17 Thread Neil Conway
This patch fixes a small memory leak in libpq: the 'pstatus' field of PGconn is a linked list of malloc'ed nodes, so it should be freed on PQfinish(). -Neil Index: src/interfaces/libpq/fe-connect.c === RCS file: /var/lib/cvs/pgsql-se

Re: [PATCHES] introduce "default_use_oids"

2003-10-17 Thread Neil Conway
On Fri, 2003-10-10 at 05:56, Manfred Koizar wrote: > On Tue, 30 Sep 2003 20:00:22 -0400, Neil Conway <[EMAIL PROTECTED]> > wrote: > >This patch adds a new GUC var, "default_use_oids" > > Shouldn't it be honoured by CREATE TABLE AS SELECT ... ? Good catch. I've attached an updated patch. I also in

Re: [PATCHES] [HACKERS] random_fract and aix compiler bug

2003-10-17 Thread Andrew Dunstan
Tom Lane wrote: "Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes: ! } while (!(z > 0 && z < MAX_RANDOM_VALUE)); ! } while (z == 0 || z == MAX_RANDOM_VALUE); This seems fairly ugly, since it eliminates the original coding's positive guarantee that the final result is in 0 < x < 1. Does

Re: [PATCHES] [HACKERS] random_fract and aix compiler bug

2003-10-17 Thread Tom Lane
"Zeugswetter Andreas SB SD" <[EMAIL PROTECTED]> writes: ! } while (!(z > 0 && z < MAX_RANDOM_VALUE)); ! } while (z == 0 || z == MAX_RANDOM_VALUE); This seems fairly ugly, since it eliminates the original coding's positive guarantee that the final result is in 0 < x < 1. Does your co

[PATCHES] [HACKERS] random_fract and aix compiler bug

2003-10-17 Thread Zeugswetter Andreas SB SD
Hi Peter, While fighting with a compiler bug here, I came across the following code, that loops here (on AIX 4.3.2) due to a compiler bug, presumably with the z < MAX_RANDOM_VALUE (it even warns at compile time): static double random_fract(void) { longz; /* random()

Re: [PATCHES] minor HISTORY improvement

2003-10-17 Thread Gaetano Mendola
Bruce Momjian wrote: Gaetano Mendola wrote: Bruce Momjian wrote: Thanks. I have applied this to the SGML docs. The HISTORY file will be updated automatically now. I didn't see in the notes about the "Migration to version 7.4" the fact that now inside a plpgsql function is not anymore accepted