CTTAS w/ DISTINCT ON crashes backend - Mailing list pgsql-general

From Mike Mascari
Subject CTTAS w/ DISTINCT ON crashes backend
Date
Msg-id 400DAFD2.8050501@mascari.com
Whole thread Raw
List pgsql-general
Hello.

I subscribed to pgsql-bugs and submitted a bug report about 10 hours
ago, but have yet to see my post go through, so I thought I'd through
this out on -general.

In a nutshell:

CREATE TEMPORARY TABLE foo AS
SELECT DISTINCT ON (x, y, z) *
FROM bar;

crashes the backend and screws up data pages associated with the catalog
under 7.4.1. It worked fine under 7.3.2. It always works when there
isn't any data. With my data however, it crashes the backend every time.

Just to be sure, I fsck'ed w/badblocks (-c -c) and ran memtest86 - no
errors. I reloaded the entire cluster from backup cleanly and executed
the same query again and it crashes at precisely the exact same place
using the above construct. No core images were left behind. If I get
enough time, I'll attach gdb and generate a backtrace. Rewritting the
query as:

CREATE TEMPORARY TABLE foo AS
SELECT *
FROM bar
LIMIT 0;

INSERT INTO foo
SELECT DISTINCT ON (x, y, z) *
FROM bar;

does not crash the backend and works as expected. 'bar', btw is also a
temporary table...

Mike Mascari






pgsql-general by date:

Previous
From: "Gavin M. Roy"
Date:
Subject: SCO Extortion
Next
From: "Marc G. Fournier"
Date:
Subject: Re: SCO Extortion