beta 2 crash with unique constraints

Lists: pgsql-hackers
From: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: beta 2 crash with unique constraints
Date: 2004-09-07 19:06:48
Message-ID: chl0rh$gbl$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi List, I have another error now here:

notice that only one backend is dying, all others are up and working.

Error - Message :

duplicate key violates unique constraint "ferber_rust_params_pkey"
FATAL: block 0 of 1663/19335/476756 is still referenced (local 2)
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while

here is a sample script causing this server-crash (simple cut and paste)

BEGIN;

CREATE SEQUENCE dbridseq;

CREATE TABLE ferber_rust_params
(fbrp_id SERIAL PRIMARY KEY,
fbrp_pos INTEGER,
fbrp_ferber VARCHAR(20),
fbrp_descr VARCHAR(80) NOT NULL,
fbrp_name VARCHAR(10) NOT NULL,
fbrp_default FLOAT4,
fbrp_formula VARCHAR(100),
dbrid VARCHAR UNIQUE DEFAULT nextval('dbridseq')
);

INSERT INTO ferber_rust_params (fbrp_id, fbrp_pos, fbrp_ferber,
fbrp_descr, fbrp_name, fbrp_default, fbrp_formula, dbrid) VALUES (6, 4,
'BSRUND', 'Vorschub aus Tabelle', 'vorschub', 360,
'vorschub-(vorschub/100*40)', '337941');

SELECT * INTO TEMP TABLE ferber_rus_205102 FROM ferber_rust_params WHERE
fbrp_ferber='BSRUND';
UPDATE ferber_rus_205102 SET fbrp_name='BSRUND1';
ALTER TABLE ferber_rus_205102 DROP COLUMN dbrid;
INSERT INTO ferber_rust_params SELECT * FROM ferber_rus_205102;

ROLLBACK;

PS : Running Windows XP Home.

Daniel

Attachment Content-Type Size
sample_script.sql text/plain 899 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: beta 2 crash with unique constraints
Date: 2004-09-11 15:58:39
Message-ID: 11136.1094918319@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Daniel Schuchardt <daniel_schuchardt(at)web(dot)de> writes:
> duplicate key violates unique constraint "ferber_rust_params_pkey"
> FATAL: block 0 of 1663/19335/476756 is still referenced (local 2)
> server closed the connection unexpectedly

This is already fixed, but thanks for the report!

regards, tom lane