From: Tom Lane <tgl@sss.pgh.pa.us>
To: david@littleriver.ca
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16871: Insert with wrong key field, causing later crash of DB.
Date: Wed, 17 Feb 2021 11:02:04 -0500
Message-ID: <2537460.1613577724@sss.pgh.pa.us> (raw)
In-Reply-To: <16871-aeb175c060566417@postgresql.org>
References: <16871-aeb175c060566417@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> This has happened three times to me over the last few months. Database
> crashes later on insert with faulty char[32] key field, matthew vs proper
> key of matt.
> 2021-02-17 00:25:29 AST ERROR: insert or update on table "employee_shift"
> violates foreign key constraint "employee_shift_userid_fkey"
> 2021-02-17 00:25:29 AST DETAIL: Key (userid)=(matthew
> ) is not present in table "users".
> 2021-02-17 00:25:29 AST STATEMENT: INSERT INTO batch.employee_shift
> (userid, date, shift,milking_number) VALUES ('matthew', '2019-09-14',
> 'am',1);
> 2021-02-17 06:23:09 AST LOG: received fast shutdown request
> 2021-02-17 06:23:09 AST LOG: aborting any active transactions
Well, that's not a crash; that's a commanded shutdown. (The *only*
way to get that message is for something to send the postmaster a
SIGINT signal.) It's fairly hard to credit that there's any direct
connection to a simple SQL error six hours earlier, either.
I'm going to venture out on a limb here, but I'd suggest reviewing
exactly how you're starting Postgres. If you're launching it from
a manual shell command, and you're not being careful to fully dissociate
it from the shell's terminal, then you can get results like this when
you later type control-C, log out from that session, etc.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david@littleriver.ca, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16871: Insert with wrong key field, causing later crash of DB.
In-Reply-To: <2537460.1613577724@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox