Assertion failure with inherited column mappings and dropped columns

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Assertion failure with inherited column mappings and dropped columns
Date: 2007-07-12 14:15:37
Message-ID: 87bqehn1x2.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I got this assertion failure today:

TRAP: FailedAssertion("!(new_max_attr >= oldrel->max_attr)", File: "prepunion.c", Line: 1292)

From running something like this:

postgres=# create table foo (i integer);
CREATE TABLE
postgres=# alter table foo add j integer;
ALTER TABLE
postgres=# alter table foo drop j;
ALTER TABLE
postgres=# create table foo2 () inherits (foo);
CREATE TABLE
postgres=# explain analyze select * from foo;
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: Succeeded.

I think there isn't actually a bug here except that the assertions are
incorrect. Everything else in the function looks ok.

diff -u -r1.142 prepunion.c
--- prepunion.c 11 Jun 2007 01:16:23 -0000 1.142
+++ prepunion.c 12 Jul 2007 14:13:11 -0000
@@ -1288,8 +1288,6 @@
ListCell *lm;

/* Create empty result array */
- Assert(new_min_attr <= oldrel->min_attr);
- Assert(new_max_attr >= oldrel->max_attr);
new_attr_needed = (Relids *)
palloc0((new_max_attr - new_min_attr + 1) * sizeof(Relids));
/* Process user attributes, with appropriate attno mapping */

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2007-07-12 14:17:59 xlog switch & last record before the switch
Previous Message Magnus Hagander 2007-07-12 14:14:23 Re: Need help with autoconf