Re: canceling query

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: canceling query
Date: 2004-04-19 13:58:47
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB34101ADC4@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Bruce Momjian wrote:
> The backend should exit automatically when the user exits psql. How
did
> you exit psql? If you just closed the window, I think the query will
> keep going even on Unix.

I pressed ctrl-c from psql. The reason I am posting this on this list
is because I am pretty sure this involves signal handling.

To be specific: is the query cancel routine checking pending signals
(using the win32 signal polling routine) and if so, is it properly
catching the signal? (If not, I'll just properly wait until it is :) ).
I suppose it is also possible my query is not checking to see if it
cancelled.

Following exiting psql, pg_stat_activity reports query still
running...since I used big tables, it basically runes forever until I
bring down the postmaster.

Also interesting is that when I kill the running backend it kills the
postmaster (I know you are not supposed to do this). Here is the log:

LOG: database system was shut down at 2004-04-19 08:14:01 Eastern
Daylight Time
LOG: checkpoint record is at 0/2D715018
LOG: redo record is at 0/2D715018; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 664978; next OID: 27086
LOG: database system is ready
ERROR: relation "order_file" does not exist
LOG: could not send data to client: Unknown error
LOG: server process (PID 3104) was terminated by signal 1
LOG: terminating any other active server processes
WARNING: terminating connection because of crash of another server
process
DETAIL: The postmaster has commanded this server process to roll back
the current transaction and e
xit, because another server process exited abnormally and possibly
corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and
repeat your command.
LOG: all server processes terminated; reinitializing
FATAL: could not attach to proper memory at fixed address:
shmget(key=5432001, addr=00F60000) faile
d: No such file or directory

Merlin

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Magnus Hagander 2004-04-19 14:33:23 Re: canceling query
Previous Message Bruce Momjian 2004-04-19 13:41:03 Re: canceling query