The following bug has been logged on the website: Bug reference: 8059 Logged by: Tarvi Pillessaar Email address: tar...@gmail.com PostgreSQL version: 9.2.4 Operating system: linux Description:
Very simple example: postgres@sbox /usr/local/pgsql $ /usr/local/pgsql/bin/psql test psql (9.2.4) Type "help" for help. test=# create sequence s; CREATE SEQUENCE test=# begin; BEGIN test=# select nextval('s'); nextval --------- 1 (1 row) Now let's crash the cluster: postgres@sbox /usr/local/pgsql $ pgrep -lf writer 13638 postgres: writer process 13639 postgres: wal writer process postgres@sbox /usr/local/pgsql $ kill -9 13638 postgres@sbox /usr/local/pgsql $ tail logfile HINT: In a moment you should be able to reconnect to the database and repeat your command. LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2013-04-12 14:28:26 EEST LOG: database system was not properly shut down; automatic recovery in progress LOG: redo starts at 0/177C9E0 LOG: record with zero length at 0/1791888 LOG: redo done at 0/1791858 LOG: last completed transaction was at log time 2013-04-12 14:29:48.562356+03 LOG: database system is ready to accept connections LOG: autovacuum launcher started postgres@sbox /usr/local/pgsql $ test=# select nextval('s'); 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 exit, 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. server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Succeeded. test=# select nextval('s'); nextval --------- 1 (1 row) test=# This problem occurs on the same conditions as described in commit af026b5d9b8ae6ef4c75a796bdac209df6411181. For another example i'm going to use very simple python script: import psycopg2 cur = psycopg2.connect('dbname=test host=/tmp/').cursor() while True: try: cur.execute("select nextval('s')") val=cur.fetchone()[0] except Exception, e: print "%s\n%s" % (val,e) break This script consumes a lot of values from sequence 's' within a single transaction, when crash occurs it prints out last value that the script got from database. postgres@sbox /usr/local/pgsql $ python test.py 132119 server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. postgres@sbox /usr/local/pgsql $ /usr/local/pgsql/bin/psql test psql (9.2.4) Type "help" for help. test=# select nextval('s'); nextval --------- 130501 (1 row) test=# -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs