Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-30 Thread Noah Misch
On Mon, Jun 30, 2014 at 09:16:45PM +, Christian Ullrich wrote: > * From: Noah Misch [mailto:n...@leadboat.com] > > Yes; the consequence of ignoring ^C is that the test postmaster would > > persist indefinitely after the ^C. The system under test doesn't care per > > No it won't, please see be

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-30 Thread Christian Ullrich
* From: Noah Misch [mailto:n...@leadboat.com] > On Mon, Jun 30, 2014 at 07:28:03PM +, Christian Ullrich wrote: > > * From: Noah Misch [mailto:n...@leadboat.com] > > > I liked the proposal here; was there a problem with it? > > > http://www.postgresql.org/message- > > > id/ca+tgmoz3ake4enctmq

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-30 Thread Noah Misch
On Mon, Jun 30, 2014 at 07:28:03PM +, Christian Ullrich wrote: > * From: Noah Misch [mailto:n...@leadboat.com] > > > I liked the proposal here; was there a problem with it? > > http://www.postgresql.org/message- > > id/ca+tgmoz3ake4enctmqmzsykc_0pjl_u4c_x47ge48uy1upb...@mail.gmail.com > > You

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-30 Thread Christian Ullrich
* From: Noah Misch [mailto:n...@leadboat.com] > I liked the proposal here; was there a problem with it? > http://www.postgresql.org/message- > id/ca+tgmoz3ake4enctmqmzsykc_0pjl_u4c_x47ge48uy1upb...@mail.gmail.com You're referring to the suggestion of accepting and ignoring the option on non-Windo

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-24 Thread Noah Misch
On Tue, Jun 24, 2014 at 09:24:43AM +, Christian Ullrich wrote: > pg_ctl does not pass the option anywhere but on Windows, and postmaster.c > does not recognize it anywhere else. If it is encountered on a platform where > it does not make sense, it will be treated like any other (unknown) long

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-24 Thread MauMau
From: "Christian Ullrich" On non-Windows platforms, the --background option is not passed, and the option handling is unmodified except for an additional pair of braces. The postmaster does not pass the option to its children on any platform. pg_ctl does not pass the option anywhere but on Wind

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-24 Thread Christian Ullrich
* From: MauMau [mailto:maumau...@gmail.com] > From: "Christian Ullrich" > > OK, here is the first draft against current master. It builds on Windows > > with VS 2012 and on FreeBSD 10 with clang 3.3. I ran the regression > > tests on Windows, they all pass. > > > > The changed behavior is limite

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-06-20 Thread MauMau
From: "Christian Ullrich" OK, here is the first draft against current master. It builds on Windows with VS 2012 and on FreeBSD 10 with clang 3.3. I ran the regression tests on Windows, they all pass. The changed behavior is limited to Windows, where it now silently ignores Ctrl-C and Ctrl-Break

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-20 Thread Christian Ullrich
OK, here is the first draft against current master. It builds on Windows with VS 2012 and on FreeBSD 10 with clang 3.3. I ran the regression tests on Windows, they all pass. The changed behavior is limited to Windows, where it now silently ignores Ctrl-C and Ctrl-Break when started via pg_ctl

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-16 Thread Robert Haas
On Tue, Apr 15, 2014 at 2:23 PM, Christian Ullrich wrote: > * From: Robert Haas >> On Mon, Apr 14, 2014 at 2:16 AM, Christian Ullrich >> wrote: > >> > I meant creating a new one, yes. If, say, PGSQL_BACKGROUND_JOB was >> > set, the postmaster etc. would ignore the events. >> >> Why not just pass

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-15 Thread Amit Kapila
On Tue, Apr 15, 2014 at 11:53 PM, Christian Ullrich wrote: > * From: Robert Haas >> Why not just pass a command-line switch? > > Because, as I wrote in the message you are quoting, I did not think that > having a command-line option for the sole purpose of telling the > postmaster who its parent i

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-15 Thread Christian Ullrich
* From: Amit Kapila > On Mon, Apr 14, 2014 at 11:46 AM, Christian Ullrich > wrote: > > * From: Amit Kapila > >> Do you mean to say use some existing environment variable? > >> Introducing an environment variable to solve this issue or infact > >> using some existing environ variable doesn't see

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-15 Thread Christian Ullrich
* From: Bruce Momjian > On Mon, Apr 14, 2014 at 09:34:14AM +0530, Amit Kapila wrote: > > The problem can be solved this way, but the only question here is > > whether it is acceptable for users to have a new console window for > > server. > > > > Can others also please share their opinion if this

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-15 Thread Christian Ullrich
* From: Robert Haas > On Mon, Apr 14, 2014 at 2:16 AM, Christian Ullrich > wrote: > > I meant creating a new one, yes. If, say, PGSQL_BACKGROUND_JOB was > > set, the postmaster etc. would ignore the events. > > Why not just pass a command-line switch? Because, as I wrote in the message you are

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-15 Thread Robert Haas
On Mon, Apr 14, 2014 at 2:16 AM, Christian Ullrich wrote: > I meant creating a new one, yes. If, say, PGSQL_BACKGROUND_JOB was set, > the postmaster etc. would ignore the events. Why not just pass a command-line switch? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Pos

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-14 Thread Amit Kapila
On Tue, Apr 15, 2014 at 4:21 AM, Bruce Momjian wrote: > On Mon, Apr 14, 2014 at 09:34:14AM +0530, Amit Kapila wrote: >> The problem can be solved this way, but the only question here is whether >> it is acceptable for users to have a new console window for server. >> >> Can others also please shar

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-14 Thread Amit Kapila
On Mon, Apr 14, 2014 at 11:46 AM, Christian Ullrich wrote: > * From: Amit Kapila >> Do you mean to say use some existing environment variable? >> Introducing an environment variable to solve this issue or infact using >> some existing environ variable doesn't seem to be the best way to pass >> suc

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-14 Thread Bruce Momjian
On Mon, Apr 14, 2014 at 09:34:14AM +0530, Amit Kapila wrote: > The problem can be solved this way, but the only question here is whether > it is acceptable for users to have a new console window for server. > > Can others also please share their opinion if this fix (start server in new > console)

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-13 Thread Christian Ullrich
* From: Amit Kapila > On Sun, Apr 13, 2014 at 5:59 PM, Christian Ullrich > wrote: > > There are some possible solutions: > > > > - pg_ctl could set an environment variable (unless it has to be > > compatible with postmasters from different versions, and it does > > not, does it?). > > Do yo

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-13 Thread Amit Kapila
On Sun, Apr 13, 2014 at 5:59 PM, Christian Ullrich wrote: > There are some possible solutions: > > - pg_ctl could set an environment variable (unless it has to be compatible > with postmasters from different versions, and it does not, does it?). Do you mean to say use some existing environment

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-13 Thread Christian Ullrich
* From: Amit Kapila > On Sat, Apr 12, 2014 at 12:36 PM, Christian Ullrich > wrote: > > * From: Amit Kapila > > > >> Another thing to decide about this fix is that whether it is okay to > >> fix it for CTRL+C and leave the problem open for CTRL+BREAK? > >> (The current option used (CREATE_NEW_PROC

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-12 Thread Amit Kapila
On Sat, Apr 12, 2014 at 12:36 PM, Christian Ullrich wrote: > * From: Amit Kapila > >> Another thing to decide about this fix is that whether it is okay to fix >> it for CTRL+C and leave the problem open for CTRL+BREAK? >> (The current option used (CREATE_NEW_PROCESS_GROUP) will handle only >> CTRL

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-12 Thread Christian Ullrich
* From: Amit Kapila > Another thing to decide about this fix is that whether it is okay to fix > it for CTRL+C and leave the problem open for CTRL+BREAK? > (The current option used (CREATE_NEW_PROCESS_GROUP) will handle only > CTRL+C). I can think of three situations in which a postgres process c

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-11 Thread Amit Kapila
On Fri, Apr 11, 2014 at 4:42 PM, Andrew Dunstan wrote: > On 04/11/2014 01:35 AM, Amit Kapila wrote: >> I don't think this is a complete fix, for example what about platform >> where >> _CreateRestrictedToken() is not supported. For Example, the current >> proposed fix will not work for below case

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-11 Thread Andres Freund
On 2014-04-11 07:12:50 -0400, Andrew Dunstan wrote: > > On 04/11/2014 01:35 AM, Amit Kapila wrote: > >On Fri, Apr 11, 2014 at 3:14 AM, Bruce Momjian wrote: > >>Can someone with Windows expertise comment on whether this should be > >>applied? > >I don't think this is a complete fix, for example wh

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-11 Thread Andrew Dunstan
On 04/11/2014 01:35 AM, Amit Kapila wrote: On Fri, Apr 11, 2014 at 3:14 AM, Bruce Momjian wrote: Can someone with Windows expertise comment on whether this should be applied? I don't think this is a complete fix, for example what about platform where _CreateRestrictedToken() is not supported.

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Amit Kapila
On Fri, Apr 11, 2014 at 3:14 AM, Bruce Momjian wrote: > > Can someone with Windows expertise comment on whether this should be > applied? I don't think this is a complete fix, for example what about platform where _CreateRestrictedToken() is not supported. For Example, the current proposed fix w

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Haribabu Kommi
On Fri, Apr 11, 2014 at 12:12 PM, Bruce Momjian wrote: > On Fri, Apr 11, 2014 at 11:58:58AM +1000, Haribabu Kommi wrote: >> On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian wrote: >> > >> > Can someone with Windows expertise comment on whether this should be >> > applied? >> >> I tested the same in

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Bruce Momjian
On Fri, Apr 11, 2014 at 11:58:58AM +1000, Haribabu Kommi wrote: > On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian wrote: > > > > Can someone with Windows expertise comment on whether this should be > > applied? > > I tested the same in windows and it is working as specified. > The same background

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Haribabu Kommi
On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian wrote: > > Can someone with Windows expertise comment on whether this should be > applied? I tested the same in windows and it is working as specified. The same background running server can be closed with ctrl+break command. > -

Re: [HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-04-10 Thread Bruce Momjian
Can someone with Windows expertise comment on whether this should be applied? --- On Tue, Jan 7, 2014 at 12:44:33PM +0100, Christian Ullrich wrote: > Hello all, > > when pg_ctl start is used to run PostgreSQL in a console

[HACKERS] PostgreSQL in Windows console and Ctrl-C

2014-01-07 Thread Christian Ullrich
Hello all, when pg_ctl start is used to run PostgreSQL in a console window on Windows, it runs in the background (it is terminated by closing the window, but that is probably inevitable). There is one problem, however: The first Ctrl-C in that window, no matter in which situation, will cause