The following bug has been logged online: Bug reference: 3301 Logged by: Leszek Trenkner Email address: [EMAIL PROTECTED] PostgreSQL version: 8.3devel Operating system: Linux (Ubuntu Fiesty 7.04) Description: explain crashes server on simple (?) query Details:
When I try to EXPLAIN or EXPLAIN analyze following query, server reports crash and restarts (output from psql session follows): ------------------------------------------------ crash=# explain select t.id, foo.name from t join (select ta.id, ta.name from ta union select tb.id, tb.name from tb ) foo on foo.id = any (t.ids); 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: Failed. !> ------------------------------------------------ But, if I change UNION to UNION ALL it works as expected: ------------------------------------------------ crash=# explain select t.id, foo.name from t join (select ta.id, ta.name from ta union all select tb.id, tb.name from tb ) foo on foo.id = any (t.ids); QUERY PLAN ------------------------------------------------------- Nested Loop (cost=1.05..4.09 rows=1 width=10) Join Filter: (foo.id = ANY (t.ids)) -> Append (cost=0.00..2.06 rows=6 width=10) -> Seq Scan on ta (cost=0.00..1.03 rows=3 width=10) -> Seq Scan on tb (cost=0.00..1.03 rows=3 width=10) -> Materialize (cost=1.05..1.10 rows=5 width=47) -> Seq Scan on t (cost=0.00..1.05 rows=5 width=47) (7 rows) ------------------------------------------------------- This all on today's (2007-05-24) CSV 8.3 development version. The same bug was in SVN version build from CSV on 2007-04-27. The server's log says: ----------------------------------------- 2007-05-24 02:27:44 CEST <@ > : LOG: server process (PID 18536) was terminated by signal 11: Segmentation fault 2007-05-24 02:27:44 CEST <@ > : LOG: terminating any other active server processes 2007-05-24 02:27:44 CEST <[EMAIL PROTECTED] postgres> idle: WARNING: terminating connection because of crash of another server process 2007-05-24 02:27:44 CEST <[EMAIL PROTECTED] postgres> idle: 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. 2007-05-24 02:27:44 CEST <[EMAIL PROTECTED] postgres> idle: HINT: In a moment you should be able to reconnect to the database and repeat your command. . . . 2007-05-24 02:27:44 CEST <@ > : LOG: all server processes terminated; reinitializing --------------------------------------------------- I'll post schema for bug recreation on pgsql-bugs. Greetings, Leszek Trenkner ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match