pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nick Renders <postgres@arcict.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Postgres 12.1 : UPPER() in WHERE clause restarts server
Date: Sat, 08 Feb 2020 17:45:52 -0500
Message-ID: <30015.1581201952@sss.pgh.pa.us> (raw)
In-Reply-To: <CEF2C288-13E6-4727-81D0-0775F40F313B@arcict.com>
References: <CEF2C288-13E6-4727-81D0-0775F40F313B@arcict.com>

"Nick Renders" <postgres@arcict.com> writes:
> When we do the following statement:
> 	SELECT * FROM f_gsxws_schedule WHERE UPPER(gwsc_dossier) = 'TEST'
> the Postgres service restarts.

Hm.

> Here is what is logged:
> 2020-02-08 20:21:19.942 CET [83892] LOG:  server process (PID 85456) was 
> terminated by signal 9: Killed: 9
> 2020-02-08 20:21:19.942 CET [83892] DETAIL:  Failed process was running: 
> SELECT * FROM f_gsxws_schedule WHERE UPPER(gwsc_dossier) = 'TEST'

That's mighty interesting, because signal 9 is an external SIGKILL,
not an internal-to-Postgres software fault.

If you were running on Linux I would hypothesize that your process
was getting killed by the infamous OOM killer, in which case we could
guess that for some reason this query is consuming an unreasonable
amount of memory and thereby attracting the wrath of the OOM killer.
However, I'm not aware that any such mechanism exists on macOS.

Still, since you can easily reproduce this, it'd be an idea to watch
the doomed process in "top" and see how much memory and CPU it eats
before dying.  Also look into the system log and see if there are any
relevant messages showing up there.

As Adrian suggested, a stack trace would be useful too ... although,
if this is being externally generated, it's likely that there's not
any consistent spot where it happens.  Also I'm not real sure that
it's *possible* to get a stack trace from a SIGKILL.  But if you
can get one, try to collect three or so and see if they're consistent.

Also, can you get an "EXPLAIN" of the query plan?  (I imagine EXPLAIN
ANALYZE would trigger the crash, though verifying that might be worth
the time.)

			regards, tom lane





view thread (19+ messages)  latest in thread

Message-ID: <30015.1581201952@sss.pgh.pa.us>
Permalink:  ../30015.1581201952@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30015.1581201952@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgres@arcict.com
  Subject: Re: Postgres 12.1 : UPPER() in WHERE clause restarts server
  In-Reply-To: <30015.1581201952@sss.pgh.pa.us>
  References: <CEF2C288-13E6-4727-81D0-0775F40F313B@arcict.com> <30015.1581201952@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