Re: [PATCHES] fork/exec patch

2003-12-15 Thread Magnus Hagander
> > > Why not use an anonymous pipe to send data from the parent to the > > > child process? > > > > Doesn't that require the postmaster to stay around to feed that > > information into the pipe or can the postmaster just shove the data > > and continue on, and how do the old pipes get cleaned

Re: [PATCHES] psql \i handling ~ in specified file name

2003-12-21 Thread Magnus Hagander
>Zach Irmen said: >> "Tom Lane" <[EMAIL PROTECTED]> writes: >>> What happens if getenv("HOME") returns NULL? >> >> Yeah, the strdup fails. I'll take it out to fix that. >> >>> You also need to think about Windows >> >> Can I just ifndef WIN32 and not think about it? I'm not sure how that >> would w

[PATCHES] Win32 signal code - first try

2004-01-08 Thread Magnus Hagander
Hi! Here is a first sketch at Win32 signal handling. First a couple of comments: * This is just two files. It is not integrated with postgresql yet. * Uses named pipes. Shared mem was slightly faster, named pipes a lot cleaner. And the signal handlers themselves should not be performance critica

Re: [PATCHES] WIN32 psql Ctrl+C support

2004-01-14 Thread Magnus Hagander
You need to make all variable access (including libpq, I think) in the handler threadsafe. The control handler will execute on a different thread from the main one (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc /base/handlerroutine.asp). One way to do this could be t

[PATCHES] Win32 signals patch

2004-01-25 Thread Magnus Hagander
Here's the latest win32 signals code, this time in the form of a patch against the latest shapshot. It also includes the replacement of kill() with pqkill() and sigsetmask() with pqsigsetmask(). Passes all tests fine on my linux machine once applied. Still doesn't link completely on Win32 - there

[PATCHES] Win32 signals patch #2

2004-02-02 Thread Magnus Hagander
Hello! Here's step #2 in win32 signals handling, containing the following: 1) Per discussion with Bruce, reverts the change from kill() to pqkill() on all platforms. Instead, #define away kill() to pqkill() in port/win32.h, and just use kill() directly on unix platforms. Similar changes for pqsi

Re: [PATCHES] [pgsql-hackers-win32] Win32 signals patch #2

2004-02-02 Thread Magnus Hagander
Ehh, scratch that. That file had pqselect call itself.. Here is an updated version of select.c for backend/port/win32. The patch stays the same. //mha >-Original Message- >From: Magnus Hagander >Sent: den 2 februari 2004 22:35 >To: pgsql-hackers-win32 >Cc: [EMAIL PROT

[PATCHES] New win32 signals patch (3)

2004-02-03 Thread Magnus Hagander
Ok, time for yet another signals patch :-) This one replaces the one I posted yesterday - I managed to mess up my build environment pretty bad, so while that patch worked in that one, it would not work on a clean system. There was also a clean bug in pqselect with regards to NULL timeouts. As be

[PATCHES] win32 signals, part 4

2004-02-04 Thread Magnus Hagander
Ok, here we go again. Taking into account Claudios comments on the previous patch, as well as some more fooling around here of my own, here's a fourth (and final?) one. If there are no further comments from Claudio or anyone else, I feel this is now ready to be applied. Differences from last ver

Re: [PATCHES] [pgsql-hackers-win32] win32 signals, part 4

2004-02-04 Thread Magnus Hagander
Ok, so apparantly I was supposed to attach a file there. //Magnus >-Original Message- >From: Magnus Hagander >Sent: den 4 februari 2004 23:09 >To: [EMAIL PROTECTED] >Cc: pgsql-hackers-win32; Claudio Natoli >Subject: [pgsql-hackers-win32] win32 signals, part 4 > &g

[PATCHES] temp patch for win32 readdir issue

2004-02-04 Thread Magnus Hagander
Ok, so I know this is pretty ugly. But there is a bug in mingw (current release - it's fixed in the snapshot version) with regards to readdir() (see previous mails on win32-hackers). Basically, it doesn't set errno correctly. This patch will catch this error with regards to the readdir(), wrap a c

Re: [PATCHES] temp patch for win32 readdir issue

2004-02-04 Thread Magnus Hagander
Oops. Naturally, if this is accepted, the same change needs to be done in xlog.c. I can update the patch if you want me to, or you can jus tmanually copy the code over :) //Magnus >-Original Message- >From: Magnus Hagander >Sent: den 4 februari 2004 23:44 >To: [EMAIL PROTECT

Re: [PATCHES] win32 signals, part 4

2004-02-06 Thread Magnus Hagander
>> Taking into account Claudios comments on the previous patch, >as well as >> some more fooling around here of my own, here's a fourth (and final?) >> one. Actually, please hold just a second :-) I have an updated version of this patch that fixes the remaining small issue (FATAL on failure to s

Re: [pgsql-hackers-win32] [PATCHES] win32 signals, part 5

2004-02-06 Thread Magnus Hagander
>>> Taking into account Claudios comments on the previous patch, >>as well as >>> some more fooling around here of my own, here's a fourth >(and final?) >>> one. > >Actually, please hold just a second :-) > >I have an updated version of this patch that fixes the remaining small >issue (FATAL on f

[PATCHES] Updated win32 readdir patch

2004-02-08 Thread Magnus Hagander
Hello! Here is an updated version of the win32 readdir patch. 1) Now puts in exactly the same change as the current-cvs mingw code does. (see http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dirent.c?r1= 1.3&r2=1.4, second part of the patch). 2) Updates both xlog.c and slru.c in backe

Re: [pgsql-hackers-win32] [PATCHES] win32 signals, part 5

2004-02-08 Thread Magnus Hagander
Actually, it seems I forgot to attach the actual patch *again*. Sheesh. Here goes. //Magnus >Here's the new one. Turns out I had already fixed the one part >I thought >I still had, so it was already ready. > >Changes since last patch: > >1) Error messages in pgwin32_signal_initialize() are no

Re: [PATCHES] Updated win32 readdir patch

2004-02-08 Thread Magnus Hagander
>> Here is an updated version of the win32 readdir patch. > >> 1) Now puts in exactly the same change as the current-cvs mingw code >> does. (see >> >>http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dir ent.c?r1=3D >> 1.3&r2=3D1.4, second part of the patch). > I don't really agree wit

Re: [PATCHES] win32 inode fix

2004-02-09 Thread Magnus Hagander
> Claudio Natoli <[EMAIL PROTECTED]> writes: > > Under Win32, stat() returns an st_ino field, but it has no > meaning (on > > Win2K, and possibly all Win32 variants, it is always 0). > > MSDN says: > > Number of the information node (the inode) for the file > (UNIX-specific). On UNIX fi

[PATCHES] win32 patch: Signal delivery when blocking on semaphore

2004-02-12 Thread Magnus Hagander
This patch makes the "block on semaphore" interruptible by signals on win32. Without this, you can't kill a backend when it's waiting on a lock. //Magnus win32_semint.patch Description: win32_semint.patch ---(end of broadcast)--- TIP 8: explain an

[PATCHES] win32 setitimer implementation

2004-02-12 Thread Magnus Hagander
Hello! Here is a patch that implements setitimer() on win32. With this patch applied, deadlock detection and statement_timeout now works. The file timer.c goes into src/backend/port/win32/. The patch also removes two lines of "printf debugging" accidentally left in pqsignal.h, in the console con

Re: [PATCHES] [pgsql-hackers-win32] win32 setitimer implementation

2004-02-17 Thread Magnus Hagander
just a new timer.c //Magnus >-Original Message- >From: Claudio Natoli [mailto:[EMAIL PROTECTED] >Sent: den 17 februari 2004 12:25 >To: Magnus Hagander; [EMAIL PROTECTED]; >[EMAIL PROTECTED] >Subject: RE: [pgsql-hackers-win32] win32 setitimer implementation > >

Re: [PATCHES] Minor fixes (mostly win32)

2004-02-26 Thread Magnus Hagander
> For application to HEAD, following community review. > > * Mostly, casting etc to remove compilation warnings in win32 > only code. > > * main.c: set _IONBF to stdout/stderr under win32 (under > win32, _IOLBF defaults to full buffering) > > * pg_resetxlog/Makefile: ensures dirmod.o gets clea

[PATCHES] Patch for select and APC on win32

2004-03-22 Thread Magnus Hagander
Hi! Here's a patch implementing the "thread method" to workaround the bug with socket calls in signal handlers. See details in mail to pgsql-hackers-win32 a couple of minutes ago. //Magnus <> apc_socket.patch Description: apc_socket.patch ---(end of broadcast)---

[PATCHES] Initial eventlog support on win32

2004-03-22 Thread Magnus Hagander
This patch adds initial eventlog support on win32. It's good enough for most purposes, but we will probably want a specific message DLL later to format the messages nicer. The patch mimcs the syslog handling in most cases. It also hijacks the syslog guc variable. Since syslog is not available on w

Re: [PATCHES] Initial eventlog support on win32

2004-03-23 Thread Magnus Hagander
> > Magnus Hagander wrote: > >> The patch mimcs the syslog handling in most cases. It also hijacks > >> the syslog guc variable. > > > I'm less happy about this. In fact the 0 | 1 | 2 for syslog is very > > hokey anyway. What is more, it is not

Re: [PATCHES] Patch for select and APC on win32

2004-03-23 Thread Magnus Hagander
> > Here's a patch implementing the "thread method" to > workaround the bug > > with socket calls in signal handlers. See details in mail to > > pgsql-hackers-win32 a couple of minutes ago. > > Looks ok, but wouldn't it be better placed in pgstat.c? Actually, I don't think so. I considered it,

Re: [PATCHES] Patch for select and APC on win32

2004-03-23 Thread Magnus Hagander
>> > > Here's a patch implementing the "thread method" to >> > workaround the bug >> > > with socket calls in signal handlers. See details in mail to >> > > pgsql-hackers-win32 a couple of minutes ago. >> > >> > Looks ok, but wouldn't it be better placed in pgstat.c? >> >> Actually, I don't th

Re: [PATCHES] Updated logging config (was: Initial eventlog support on win32 )

2004-03-23 Thread Magnus Hagander
L PROTECTED] >Sent: den 23 mars 2004 16:02 >To: Magnus Hagander >Cc: Andrew Dunstan; [EMAIL PROTECTED] >Subject: Re: [PATCHES] Initial eventlog support on win32 > > >"Magnus Hagander" <[EMAIL PROTECTED]> writes: >> Based on what Andrew wrot

Re: [PATCHES] APC/socket fix (final?)

2004-03-25 Thread Magnus Hagander
Thanks. I was getting to that, but hadn't started :-) Per our discussion off-list, I agree with this method, and the patch looks fine to me. //Magnus > -Original Message- > From: Claudio Natoli [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 25, 2004 2:07 AM > To: '[EMAIL PROTECTED]'

Re: [PATCHES] APC/socket fix (final?)

2004-03-25 Thread Magnus Hagander
>Claudio Natoli <[EMAIL PROTECTED]> writes: >> + #ifdef WIN32 >> +/* Interrupted by socket/APC interaction? */ >> +if (n < 0 && GetLastError() == ERROR_IO_PENDING) >> +errno = EINTR; >> + #endif > >This seems a bit schizophrenic; if you can assign to errno, >why can't you >read

Re: [PATCHES] APC/socket fix (final?)

2004-03-26 Thread Magnus Hagander
>> Ugh. Is there a way we can insert a wrapper layer without >modifying the >> call sites? I'm thinking of some kind of macro hack, say >> [snip] > >Sure. Think we've even done this before (also, prevents >developers needing to remember to use pg_*). Yup, it's done to redefine kill() to pqkill

Re: [PATCHES] APC/socket fix (final?)

2004-03-26 Thread Magnus Hagander
>> Hopeless, or cute, work-around? > >It's possibly workable in the limited context of the postmaster, but >I've got doubts about doing it in libpq where we can't assume we know >what the surrounding application will do. No need to touch the frontend parts at all. Our APCs are server side only, so

Re: [PATCHES] APC/socket fix (final?)

2004-03-26 Thread Magnus Hagander
Hopeless, or cute, work-around? >>> >>> It's possibly workable in the limited context of the postmaster, but >>> I've got doubts about doing it in libpq where we can't >assume we know >>> what the surrounding application will do. > >> No need to touch the frontend parts at all. Our APCs are

Re: [PATCHES] APC/socket fix (final?)

2004-03-26 Thread Magnus Hagander
>> I don't think it's a good idea in general to redefine something as >> fundamental as select, send, recv etc from libpq-fe.h (or >files included >> from there). > >Certainly not; the redefinition would have to be in files that are not >part of the exported API. However this is not difficult.

Re: [PATCHES] APC/socket fix (final?)

2004-03-26 Thread Magnus Hagander
>> The third option is to redefine all these functions into our own, and >> implement our own emulation layer. This means our own >select(), send(), >> recv() (more? I don't think so). And have these call the >native winsock >> APIs (WSAEventSelect(), WSASend(), WSARecv() etc). These >functions

Re: [PATCHES] Updated logging config (was: Initial eventlog support on win32 )

2004-03-27 Thread Magnus Hagander
>On 23-Mar-04, at 4:57 PM, Magnus Hagander wrote: >> Something about like this? > >Looks good. One trivial gripe: you need to update psql/tab-complete.c Thanks. Since I've heard nothing else, here is an updated patch that does this, and also adds some documentation (please do

Re: [PATCHES] MSFT compiler fixes + misc

2004-04-03 Thread Magnus Hagander
A thought about this - how about converting pgpiperead() and pgpipewrite() into functions intead of macros (on win32 - still redifining them on != win32), mimicking the behaviour of read() and write()? Then we could do awya with the #ifdefs at the points where its used, and just expect the normal U

[PATCHES] New socket code for win32

2004-04-04 Thread Magnus Hagander
Here's an attempt at new socket and signal code for win32. It works on the principle of turning sockets into non-blocking, and then emulate blocking behaviour on top of that, while allowing signals to run. Signals are now implemented using an event instead of APCs, thus getting rid of the issue of

Re: [PATCHES] MSFT compiler fixes + misc

2004-04-05 Thread Magnus Hagander
> > A thought about this - how about converting pgpiperead() and > > pgpipewrite() into functions intead of macros (on win32 - still > > redifining them on != win32), mimicking the behaviour of read() and > > write()? > > And #def'ing them to be read + write under win32? Don't want > to change

Re: [PATCHES] New socket code for win32

2004-04-09 Thread Magnus Hagander
EINTR for consistency //Magnus >-Original Message- >From: Magnus Hagander >Sent: den 4 april 2004 22:08 >To: [EMAIL PROTECTED] >Subject: [PATCHES] New socket code for win32 > > >Here's an attempt at new socket and signal code for win32. > >It works on the pri

[PATCHES] Fix for socket error msgs on win32

2004-04-19 Thread Magnus Hagander
Per discussion earlier today, here is a fix that lets ereport() on win32 report socket errors. //Magnus <> win32_socketerror.patch Description: win32_socketerror.patch ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ?

[PATCHES] FW: Timezone library

2004-04-21 Thread Magnus Hagander
This mail apparantly didn't make it through because it was too large. Resending it without the largest file, tzlib.tgz. I've put this file (+ the patches) on http://www.hagander.net/pgsql/. //Magnus > -Original Message- > From: Magnus Hagander > Sent: Sunday, Apr

Re: [PATCHES] pgkill for windows

2004-05-11 Thread Magnus Hagander
> Andrew Dunstan wrote: > > Attached are 2 files needed to create a pgkill facility for > Windows, > > and a complementary patch for src/bin/Makefile > > If it's only for the regression tests, then it should go into > that directory. It is not. It is a tool required to do any "controlled backe

Re: [PATCHES] pgkill for windows

2004-05-11 Thread Magnus Hagander
> > >>Attached are 2 files needed to create a pgkill facility > for Windows, > > >>and a complementary patch for src/bin/Makefile > > >> > > >> > > > > > >If it's only for the regression tests, then it should go into that > > >directory. > > > > > > > > > > > > > > > > In effect you need

Re: [PATCHES] Run-as-admin warning for win32

2004-05-04 Thread Magnus Hagander
> 1. You forgot to check "localsystem", as well as "domain > admins". These two have even higher permissions than the ones > you test for, and one of them is the default if Postgre ever > makes it to become a service. Not at all. Local System is a member of the Administrators group (no, it does

Re: [PATCHES] Run-as-admin warning for win32

2004-05-04 Thread Magnus Hagander
> >> Why? If we refuse to run as root on Unix, I do not see an > argument > >> for being more forgiving on Windows. > > > I am not sure it is as easy to run as non-admin on Win32 as > it is to > > run as non-root on Unix. Is it? It is a little bit more tricky, but not much. I'd say it's mor

Re: [PATCHES] win32 service proposal

2004-05-04 Thread Magnus Hagander
> I played a bit with that code. According to Microsoft samples > for service managers, errors and events should be logged to > eventlog. so I added a function (almost copy of sample > service code), it's a messy, but it was enough to see what is > happening with the service. Consider using e

Re: [PATCHES] Run-as-admin warning for win32

2004-05-04 Thread Magnus Hagander
> > . if the installer is running as Administrator, it should create a > > Postgres user > > > IOW, we need to make it as easy as possible to be secure. > > No objection to that idea ... I don't think we should create a postgres user. We should tell the guy who installs it to do that, and have

Re: [PATCHES] Run-as-admin warning for win32

2004-05-04 Thread Magnus Hagander
> > The installer-skeleton I have right now permits > installation as local > > system but recommends a user account. But that's just > functionality to > > remove, so that's easily done. In the other case, it prompts for > > username and password to run as. > > How would it install on an XP

Re: [PATCHES] Run-as-admin warning for win32

2004-05-04 Thread Magnus Hagander
> > Yes, you need to create another user. > > When running as a service, just tell the installer. It > should set up > > required permissions. Then start the service as normal using the > > Service Control Manager. > > > > When running manually, you will have to grant the postgres user the > >

Re: [PATCHES] FW: Timezone library

2004-04-30 Thread Magnus Hagander
> * timezone/private.h looks like it should be picking up its > constants in another way (ie. had to comment out > HAVE_SYMLINK). Looks like we'll need to spend some time in > this file if we want it platform independent. Yes, that's the place that the tz lib stores these things. Though in tha

Re: [PATCHES] win32: whitespace in dir names, shmem bug

2004-05-03 Thread Magnus Hagander
> For application to HEAD, following community review. > > sysv_shmem.c patch is to correct a bug that prevents the > postmaster recovering from an unexpected backend termination. Great to see you caught that. That's one more off my list of things to dig into. I expected it was something that ea

Re: [PATCHES] win32: whitespace in dir names, shmem bug

2004-05-03 Thread Magnus Hagander
> > Great to see you caught that. That's one more off my list > of things to > > dig into. > > Are there any not listed here: > http://momjian.postgresql.org/main/writings/pgsql/win32.html > > If so, they probably should be put up. I don't think so. It's mostly sub-issues under the known loca

Re: [PATCHES] win32 service proposal

2004-05-03 Thread Magnus Hagander
> Spoke about this off-list with Magnus; he's strongly for > stand-alone; I'm fence-sitting. We see that clearly there are > some niceties to having this in the postmaster (one less exe > to build/configure; same install set for win/*nix; etc), but > the downsides include minor impact on the co

[PATCHES] Run-as-admin warning for win32

2004-05-03 Thread Magnus Hagander
For review, comments and possible application to HEAD. This code implements a warning when the postmaster is started as a high-privilege account on win32 (administrator or power users). Previously, postgresql has exited out on Unix when running as root - this is a similar check, with the following

Re: [PATCHES] Timezone code, one more try

2004-05-18 Thread Magnus Hagander
. Sorry about not checking this before I sent it. //Magnus > -Original Message- > From: Magnus Hagander > Sent: Monday, May 17, 2004 10:57 PM > To: [EMAIL PROTECTED] > Subject: [PATCHES] Timezone code, one more try > > Ok, here is another attempt at the timezone

Re: [PATCHES] [COMMITTERS] pgsql-server/src backend/main/main.c backend/p ...

2004-05-19 Thread Magnus Hagander
> > > so it has to be earlier. I can put it much earlier in > both postgres > > > and postmaster, but by having it in main.c, I have it in only one > > > place. It doesn't do any palloc or anything fancy, because of > > > course it is also used by client apps. > > > > > Patch attached and ap

[PATCHES] Cancel/Kill backend functions

2004-05-21 Thread Magnus Hagander
Per previous discussions, here are two functions to send INT and TERM signals to other backends.They permit only INT and TERM, and permits sending only to postgresql backends (as registered in pgstat). Documentation to follow. I'd appreciate some pointers as to where to put this. A new section "Ma

[PATCHES] pgstat exec cleanup

2004-05-21 Thread Magnus Hagander
This patch fixes the find_my_exec code for pgstat backends. Required for TZ stuff (and possibly others) to work in the pgstat backends. //Magnus pgstat_exec_cleanup.patch Description: pgstat_exec_cleanup.patch ---(end of broadcast)--- TIP 8: expla

Re: [PATCHES] Cancel/Kill backend functions

2004-05-23 Thread Magnus Hagander
>> Per previous discussions, here are two functions to send INT and TERM >> signals to other backends.They permit only INT and TERM, and permits >> sending only to postgresql backends (as registered in pgstat). > >Why does this depend on pgstat? ISTM it would be better to use the >per-backend PGPR

Re: [PATCHES] Cancel/Kill backend functions

2004-05-23 Thread Magnus Hagander
>> The other thought is that you're not going to have much use >of this if >> you don't have pgstat anyway - how are you going to find out which >> backends actually exist? > >Uh, what about ps(1)? Well, if you ran run ps(1), then you can probably run kill(1) too. The main point of this patch was

Re: [PATCHES] Cancel/Kill backend functions

2004-05-24 Thread Magnus Hagander
ternative. //Magnus >-Original Message- >From: Neil Conway [mailto:[EMAIL PROTECTED] >Sent: den 22 maj 2004 10:00 >To: Magnus Hagander >Cc: [EMAIL PROTECTED] >Subject: Re: [PATCHES] Cancel/Kill backend functions > > >Magnus Hagander wrote: >> Per previous dis

[PATCHES] Small patch for oracle_compat.c

2004-05-24 Thread Magnus Hagander
limits.h needed in oracle_compat.c to compile on win32. See attached patch. //Magnus <> oracle_compat.patch Description: oracle_compat.patch ---(end of broadcast)--- TIP 8: explain analyze is your friend

[PATCHES] Small change in link order

2004-05-25 Thread Magnus Hagander
This patch changes the order of libraries on the link command when linking things with pgport. This is required for win32 to build when modules in libpgport refer to global variables in the backend (right now, specifically path.c does this). And I don't see that it should cause any problems on othe

[PATCHES] win32 locale fixes

2004-05-25 Thread Magnus Hagander
The following patch fixes locale support under win32. * Saves and reloads LC_COLLATE and LC_CTYPE when a new backend is execed. Also preserved in pgstat even though it's supposedly not used there at the moment, to be on the safe side for the future. With this patch, passes regression tests with re

Re: [PATCHES] pg_ctl.c

2004-05-27 Thread Magnus Hagander
Seems it needs an implementation of the "pgwin32 special kill". Try stealing the one from backend/port/win32/signal.c (look for pqkill). Perhaps this function (not the rest of signal.c!) should be moved into port/, instead of backend/port. IIRC it depends on no other backend code. //Magnus > --

Re: [PATCHES] Relocatable locale

2004-05-27 Thread Magnus Hagander
> > You wouldn't expect the environment var to be set by an app > in those > > cases - it would be set by a sysadmin or an installer on a > system-wide > > basis when pg is installed in other than the hardcoded location. At > > least, that's the way I understood Bruce's suggestion. > > Strang

Re: [PATCHES] Relocatable locale

2004-05-27 Thread Magnus Hagander
> > > > > As for how to do it - on Windows you *can* get the > path of the > > > > > DLL that is executing your code, using GetModuleFileName(). > > > > > Hardly cross-platform, but can be done. > > > > > > > > That sounds pretty reasonable to me. > > > > > > True, and we already have our own fi

Re: [PATCHES] Cancel/Kill backend functions

2004-05-27 Thread Magnus Hagander
Arrgh, when will I ever learn :-( Attached. //Magnus >-Original Message- >From: Bruce Momjian [mailto:[EMAIL PROTECTED] >Sent: den 26 maj 2004 20:50 >To: Magnus Hagander >Cc: Neil Conway; [EMAIL PROTECTED] >Subject: Re: [PATCHES] Cancel/Kill backend functions > &

Re: [PATCHES] Cancel/Kill backend functions

2004-05-27 Thread Magnus Hagander
>> >> Okay, here is an updated patch. now uses IsBackendPid(), which is >> >> closely modeled (read cut-and-pasted) from >> >> TransactionIdIsInProgress(). > >I wonder what can happen if a backend passes the >IsBackendPid() test and >terminates just before the kill() signal? It should be pretty

Re: [PATCHES] Link errors on win32

2004-05-28 Thread Magnus Hagander
> After patching postmaster.c (see previous post) I'm unable to > link on win32 (mingw). I get the following errors: > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes > -Wmissing-declaratio > ns -L../../src/port -o postgres.exe -Wl,--base-file,postgres.base > postgres.exp access/SUBS

Re: [PATCHES] eventlog fix

2004-06-02 Thread Magnus Hagander
> The purpose of this patch is to fix an error when > log_destination is set to 'eventlog' value in postgresql.conf files. Looks good to me, just a couple of tiny things: > After discussion on win32 mailing list, I suggest to store > source under src/bin/pg_event I assume you mean src/bin/pg

Re: [PATCHES] [pgsql-hackers-win32] [HACKERS] select like...not using index

2004-06-07 Thread Magnus Hagander
>> Here is what I think happened (this might be a bug, might not): Each >> night I run initdb but I use a special postgresql.conf which is >> optimized for quick data loading. This is copied over the >default one >> after the server is started. This contains the locale >information which >> is

[PATCHES] pgpipe error reporting

2004-06-07 Thread Magnus Hagander
This patch updates pgpipe() on win32 to log exactly which part of the call fails when it does. (As it is now, there is no way to figure out the point of error). Shouldn't be a problem since it's most defintily not a performance-critical path (only called on pgstat startup ATM). This should help us

Re: [PATCHES] [pgsql-hackers-win32] [HACKERS] select like...not using index

2004-06-07 Thread Magnus Hagander
>> It certainly doesn't. There still was a bug with the locale stuff, >> though - the GUC variable was not set in the child >processes. So "show >> lc_collate" would *always* return "C", for example. attached >patch fixes >> this. > >Hm. Why were these vars not propagated by the regular >mechan

[PATCHES] stderr & win32 admin check

2004-06-14 Thread Magnus Hagander
Per previous patch, win32 required the check for admin privs to be moved from main.c into postmaster.c, because elog was not available at this time. While working on fixing that all the way (moving the unix one as well), I realised this wasn't good, and did it this way instead: * Created function

Re: [PATCHES] stderr & win32 admin check

2004-06-14 Thread Magnus Hagander
>> * Created function write_stderr(const char *fmt, ...), used >before elog >> can be used. This function will write to stderr on unix and on win32 >> fconsole. It will write to the eventlog on win32 when running as a >> service. >> * Changed all (most? I think I got all) fprintf(stderr,...) >to

Re: [PATCHES] stderr & win32 admin check

2004-06-15 Thread Magnus Hagander
> Oh, and I notice the use of the PowerUsers group - iirc, > there is no such group on NT4 domains, so the attempt to get > the SID will fail. That is one weird NT4.. :-) First of all, "Power Users" is not a domain group, it is a local group. It has nothing to do with your domain. As such,

Re: [PATCHES] stderr & win32 admin check

2004-06-15 Thread Magnus Hagander
> > This will prevent PostgreSQL being runable on NT4 by anyone > with admin > > privileges, except as a service. > > Are we actually supporting NT4? I recall quite a bit of > discussion long ago about which versions of Windows were > really reasonable to support, but I don't recall if there

Re: [PATCHES] stderr & win32 admin check

2004-06-15 Thread Magnus Hagander
>> If you mean only run one instance of postmaster as service, >> that's not true. >> If you like two pgsql servers (i.e. db clusters), you can >> install two services, both using the same binary with >> different cmd line arguments. > >In which case, what would 'net stop postgresql' do? What yo

Re: [PATCHES] stderr & win32 admin check

2004-06-15 Thread Magnus Hagander
>It hasn't been discussed, but it would be fairly trivial to >add this to the service installer. (A bit more work on the MSI >installer, but we could do with that one just installing the >default instance at least for starters). Correcting myself on this one - the MSI installer already supports

Re: [PATCHES] stderr & win32 admin check

2004-06-15 Thread Magnus Hagander
>>>It hasn't been discussed, but it would be fairly trivial to >>>add this to the service installer. (A bit more work on the MSI >>>installer, but we could do with that one just installing the >>>default instance at least for starters). >> >> Correcting myself on this one - the MSI installer alread

Re: [PATCHES] pg_autovacuum integration patch

2004-06-16 Thread Magnus Hagander
Some nitpicking on details: The comment above AutoVacMain() claims: ! * Main entry point for bgwriter process I also see a bunch of // comments, I think those are not appreciated. Haven't had time to look much at the actual functionality. Just did a quick look-through for win32 showstoppers,

Re: [PATCHES] stderr & win32 admin check

2004-06-19 Thread Magnus Hagander
omjian [mailto:[EMAIL PROTECTED] > > > >Magnus, where are we on this refactoring process. > >--- > > >Magnus Hagander wrote: >> >> * Created function write_stderr(const char *fmt, ...),

Re: [PATCHES] eventlog fix

2004-06-19 Thread Magnus Hagander
We require the MS "MC" compiler to build the BIN file (note - this is not C - this is the "Message Compiler"). The Ccode should compile fine in mingw. Not requiring it is the reason we'd include the .BIN file in CVS. MC is only needed to *rebuild* it. //Magnus >-Original Message- >From:

Re: [PATCHES] pg_ctl service integration for WIN32

2004-06-20 Thread Magnus Hagander
> >Amended patch attached. >Claudio Hi! Been testing this, and found a couple of small issues. Attached is a patch that fixes these. (Note - Claudios patch is included in this one, since it hasn't been applied yet..) The issues: 1) When something goes bad, output went to stderr. No way to see t

Re: [PATCHES] stderr & win32 admin check

2004-06-20 Thread Magnus Hagander
>-Original Message- >From: Magnus Hagander >Sent: den 19 juni 2004 13:55 >To: Bruce Momjian >Cc: Tom Lane; [EMAIL PROTECTED] >Subject: Re: [PATCHES] stderr & win32 admin check > > >I plan to resubmit this patch shortly (hopefully during the weekend) >including s

[PATCHES] initdb initial password from file

2004-06-20 Thread Magnus Hagander
Attached is a patch that adds the option --pwfile= to initdb. The first line of this file is used to set the new superuser password (the same way --pwprompt asks for one). This feature is needed for the win32 GUI installer (possibly other installers?), which need a way to specify the password to b

Re: [PATCHES] Cancel/Kill backend functions -- docs

2004-06-20 Thread Magnus Hagander
(or even work at all). I tried to model it on stuff that's nearby. If not, let me know where I missed and I'll update it. //Magnus >-Original Message- >From: Bruce Momjian [mailto:[EMAIL PROTECTED] >Sent: den 2 juni 2004 23:30 >To: Magnus Hagander >Cc: Neil C

Re: [PATCHES] stderr & win32 admin check

2004-06-20 Thread Magnus Hagander
You probably would've been a lot less confused if I had actually included the *patch* along with the C file.. Sorry! //Magnus >-Original Message- >From: Bruce Momjian [mailto:[EMAIL PROTECTED] >Sent: den 20 juni 2004 20:27 >To: Magnus Hagander >Cc: Tom La

Re: [PATCHES] Show encoding in initdb messages

2004-06-21 Thread Magnus Hagander
> > The reason it will help with support is because newbies will go > > "SQL_ASCII! I don't want ascii!". > > No they won't. They will likely not even notice this message > in the sea of other messages they've never seen before; and > even if they do notice it, they will certainly not realize

Re: [PATCHES] [HACKERS] Is "trust" really a good default?

2004-07-13 Thread Magnus Hagander
>The only part of this discussion that I'd really be prepared >to buy into >is the part about *if* you use -W or --pwfile, then set up pg_hba.conf >with MD5 as the default auth (because that's probably what the user >wants anyway). But otherwise I think we should leave initdb's behavior >alone.

Re: [PATCHES] [HACKERS] Is "trust" really a good default?

2004-07-13 Thread Magnus Hagander
>>> The only part of this discussion that I'd really be prepared=20 >>> to buy into >>> is the part about *if* you use -W or --pwfile, then set up >pg_hba.conf >>> with MD5 as the default auth (because that's probably what the user >>> wants anyway). > >> Ok. Here is a patch that does this. > >...

Re: [PATCHES] serverlog rotation/functions

2004-07-14 Thread Magnus Hagander
> > Probably the big thing this program was trying to solve was for the > > server to know the output file name, even with log file > rotation, and > > I don't see a pipe and 'rotatelogs' process really addressing this. > > It could be done. Given the infrastructure we have now, it's > possib

[PATCHES] plperl win32

2004-07-14 Thread Magnus Hagander
Here is a patch required to build plperl with win32. The issues were: * perl_useshrplib gets set to "yes" and not to "true". I assume it's set to "true" on unix, so I left both. * Need to translate backslashes into slashes * The linker config coming out of perl was for MSVC and not for mingw Som

[PATCHES] win32 readline

2004-07-15 Thread Magnus Hagander
Readline is pretty badly broken under mingw. Basically, it disables the alt-gr key, which renders psql almost useless on most locales (no way to type backslash, and a whole lot of other characters, for example). This patch disables readline on win32. (meaning it's back to working the way it did in

[PATCHES] initdb authentication

2004-07-15 Thread Magnus Hagander
Ok, here is one more try at the initdb default authentication stuff. This one adds the switches "--ident" and "--trust", which will configure pg_hba.conf with ident and trust authentication respectively. If trust authentication is selected, a warning is written to pg_hba.conf. The old switches for

Re: [PATCHES] initdb authentication

2004-07-16 Thread Magnus Hagander
> > > This one makes it mandatory to pick some kind of > authentication. If > > > that's not wanted, it's easy to change it to default to > trust (which > > > I think is wrong, but we've been through that already..) > > > > I don't think I like any of this. Sooner rather than later, people >

Re: [PATCHES] plperl win32

2004-07-16 Thread Magnus Hagander
> >Magnus, why is this reassignment needed, basically the 'else' part: > >! ifeq ($(PORTNAME), win32) >! xperl_archlibexp=$(subst \,/,$(perl_archlibexp)) >! xperl_privlibexp=$(subst \,/,$(perl_privlibexp)) >! perl_embed_ldflags=-L $(xperl_archlibexp)/CORE -lperl58 >! else >! xperl_archlibexp=$(perl

Re: [PATCHES] initdb authentication

2004-07-16 Thread Magnus Hagander
Here's a version of this patch that includes documentation updates. //Magnus >-Original Message- >From: Magnus Hagander >Sent: den 15 juli 2004 23:02 >To: [EMAIL PROTECTED] >Subject: [PATCHES] initdb authentication > > >Ok, here is one more try at the

  1   2   3   4   5   6   7   >