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

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

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-

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 below.

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

2014-06-24 Thread Christian Ullrich
* From: MauMau [mailto:maumau...@gmail.com] From: Christian Ullrich ch...@chrullrich.net 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

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

2014-06-24 Thread MauMau
From: Christian Ullrich ch...@chrullrich.net 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

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-21 Thread MauMau
From: Christian Ullrich ch...@chrullrich.net 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

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 ch...@chrullrich.net wrote: * From: Robert Haas On Mon, Apr 14, 2014 at 2:16 AM, Christian Ullrich ch...@chrullrich.net wrote: I meant creating a new one, yes. If, say, PGSQL_BACKGROUND_JOB was set, the postmaster etc. would ignore the

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 ch...@chrullrich.net 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

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 ch...@chrullrich.net 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

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 fix (start

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 ch...@chrullrich.net 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

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 ch...@chrullrich.net 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

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

2014-04-14 Thread Christian Ullrich
* From: Amit Kapila On Sun, Apr 13, 2014 at 5:59 PM, Christian Ullrich ch...@chrullrich.net 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?).

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-14 Thread Amit Kapila
On Mon, Apr 14, 2014 at 11:46 AM, Christian Ullrich ch...@chrullrich.net 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

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 br...@momjian.us 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

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 ch...@chrullrich.net 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

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 ch...@chrullrich.net 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

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 can

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 ch...@chrullrich.net 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

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 br...@momjian.us 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()

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 br...@momjian.us wrote: Can someone with Windows expertise comment on whether this should be applied? I don't think this is a complete fix, for

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 and...@dunslane.net 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

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

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 br...@momjian.us 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
On Fri, Apr 11, 2014 at 11:58:58AM +1000, Haribabu Kommi wrote: On Fri, Apr 11, 2014 at 7:44 AM, Bruce Momjian br...@momjian.us 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

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 br...@momjian.us 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 br...@momjian.us wrote: Can someone with Windows expertise comment on whether this should be applied? I

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 br...@momjian.us 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

[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