[PATCHES] C locale sort in src/tools/make_ctags

2004-02-01 Thread Nicolai Tufar
Greetings, Attached is a simple one-liner for src/tools/make_ctags. If tags are sorted in locale other than C, vim complains: E432: Tags file not sorted: tags Solution is to set LANG variable to C before calling sort. Regards, Nicolai Tufar ctags-sort.diff Description: Binary data

Re: [PATCHES] reading uninitialized buffer

2004-02-01 Thread Andrew Dunstan
This time it is my fault, rather than freebsd's ;-) I think I can do something slightly cleaner than this, though, by hoisting the buf termination above the test. We could also replace the strncmp calls with strcmp calls if the buffer has its nul. I will post something soon. cheers andrew

Re: [PATCHES] reading uninitialized buffer

2004-02-01 Thread Andrew Dunstan
... and here it is. As for the test being outside the if statement, it is true that that might waste a few cycles, but it hardly matters. Personally, I would prefer to replace the if statement with this: if (c == EOF || c == '\n') { *buf = '\0'; return; } and then it

Re: [PATCHES] reading uninitialized buffer

2004-02-01 Thread Dennis Bjorklund
On Sun, 1 Feb 2004, Andrew Dunstan wrote: As for the test being outside the if statement, it is true that that might waste a few cycles, but it hardly matters. The cycles are not important. My fix wasn't the most optimized either if one should count cycles. It was terminating the string twice

Re: [PATCHES] reading uninitialized buffer

2004-02-01 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: ... and then it wouldn't be an issue at all, but I know some people don't like early function returns - is there a general postgres style rule about it? Hardly; we do that a lot. Write it however it seems clearest. regards,

Re: [PATCHES] Patch for psql startup clarity

2004-02-01 Thread David Fetter
In article [EMAIL PROTECTED] you wrote: On Fri, Jan 30, 2004 at 11:53:19PM +0100, Markus Bertheau wrote: ?? ??, 30.01.2004, ?? 23:45, David Fetter ??: \? for help on internal slash (i.e. psql) commands I think it should be \? for help with psql commands That was my 1st

Re: [PATCHES] reading uninitialized buffer

2004-02-01 Thread Andrew Dunstan
OK, then *This* patch does it the way I think is clearest. Most of it is just reindenting. cheers andrew Dennis Bjorklund wrote: On Sun, 1 Feb 2004, Andrew Dunstan wrote: As for the test being outside the if statement, it is true that that might waste a few cycles, but it hardly matters.

Re: [PATCHES] Patch for psql startup clarity

2004-02-01 Thread Peter Eisentraut
Markus Bertheau wrote: , 30.01.2004, 23:45, David Fetter : \? for help on internal slash (i.e. psql) commands I think it should be \? for help with psql commands firstly because the adjective internal is really subjective and secondly because the fact that it's internal in whatever way

Re: [PATCHES] C locale sort in src/tools/make_ctags

2004-02-01 Thread Peter Eisentraut
Nicolai Tufar wrote: Greetings, Attached is a simple one-liner for src/tools/make_ctags. If tags are sorted in locale other than C, vim complains: E432: Tags file not sorted: tags Solution is to set LANG variable to C before calling sort. That should be LC_ALL.

Re: [PATCHES] Patch for psql startup clarity

2004-02-01 Thread David Fetter
On Sun, Feb 01, 2004 at 08:09:44PM +0100, Peter Eisentraut wrote: Markus Bertheau wrote: В Птн, 30.01.2004, в 23:45, David Fetter пишет: \? for help on internal slash (i.e. psql) commands I think it should be \? for help with psql commands firstly because the adjective internal

Re: [PATCHES] C locale sort in src/tools/make_ctags

2004-02-01 Thread Nicolai Tufar
-Original Message- From: Peter Eisentraut [mailto:[EMAIL PROTECTED] Nicolai Tufar wrote: Greetings, Attached is a simple one-liner for src/tools/make_ctags. If tags are sorted in locale other than C, vim complains: E432: Tags file not sorted: tags Solution is to set

Re: [PATCHES] pg_generate_sequence and info_schema patch (Was: SELECT

2004-02-01 Thread Joe Conway
Tom Lane wrote: Joe Conway [EMAIL PROTECTED] writes: regression=# select * from pg_generate_sequence(8, 4); ERROR: finish is less than start Hm, would it be better just to return an empty set? Certainly I'd expect pg_generate_sequence(1,0) to return an empty set with no error. OK -- for this and

Re: [PATCHES] Patch for psql startup clarity

2004-02-01 Thread Tom Lane
Markus Bertheau [EMAIL PROTECTED] writes: On Вск, 2004-02-01 at 20:09 +0100, Peter Eisentraut wrote: Well, it's internal to psql, meaning that it is only available within psql. I think help on psql commands completely expresses that they are only available in psql. Do you agree? Just my 2

Re: [PATCHES] pg_generate_sequence and info_schema patch (Was: SELECT Question)

2004-02-01 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: Tom Lane wrote: Joe Conway [EMAIL PROTECTED] writes: regression=# select * from pg_generate_sequence(8, 4); ERROR: finish is less than start Hm, would it be better just to return an empty set? Certainly I'd expect pg_generate_sequence(1,0) to return

Re: [PATCHES] pg_generate_sequence and info_schema patch (Was: SE

2004-02-01 Thread Claudio Natoli
Tom Lane wrote: If you want to allow the 3-parameter form to specify a negative step size, that's fine. But don't use a heuristic to guess the intended step direction. Have to agree. Ever used MatLab? They have a fairly intuitive approach: 1:5 = [1 2 3 4] 1:2:5 = [1 3 5] 5:1 = empty

Re: [PATCHES] C locale sort in src/tools/make_ctags

2004-02-01 Thread Bruce Momjian
Nicolai Tufar wrote: -Original Message- From: Peter Eisentraut [mailto:[EMAIL PROTECTED] Nicolai Tufar wrote: Greetings, Attached is a simple one-liner for src/tools/make_ctags. If tags are sorted in locale other than C, vim complains: E432: Tags file not sorted:

Re: [PATCHES] reading uninitialized buffer

2004-02-01 Thread Neil Conway
Andrew Dunstan [EMAIL PROTECTED] writes: OK, then *This* patch does it the way I think is clearest. Most of it is just reindenting. Unless anyone objects, I'll review and apply this patch within 24 hours. Thanks for the patch, Dennis and Andrew. -Neil ---(end of

Re: [PATCHES] [pgsql-hackers-win32] win32 patch: allows source to be compiled

2004-02-01 Thread Bruce Momjian
Patch applied. Thanks. I had to make this adjustment for non-win32. The original patch had them used for Unix. --- SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl

Re: [PATCHES] pg_generate_sequence and info_schema patch (Was: SELECT

2004-02-01 Thread Joe Conway
Tom Lane wrote: folklore has it that Mariner II was lost to exactly such a bug). Ouch -- got the point. If you want to allow the 3-parameter form to specify a negative step size, that's fine. But don't use a heuristic to guess the intended step direction. The attached patch implements the

Re: [PATCHES] pg_generate_sequence and info_schema patch (Was: SELECT Question)

2004-02-01 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: The one corner case not discussed is a step size of zero. Currently it returns zero rows, but I considered having it generate an ERROR. I'd go for ERROR --- can't think of any reason to do otherwise, nor any standard programming language that wouldn't