Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B058D1337B43 for ; Sat, 12 Feb 2011 10:39:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 77001-06 for ; Sat, 12 Feb 2011 14:39:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id 514F51337990 for ; Sat, 12 Feb 2011 10:39:24 -0400 (AST) Received: from alap2.localnet (unknown [80.187.220.125]) by mail.anarazel.de (Postfix) with ESMTPSA id F1842448003; Sat, 12 Feb 2011 15:39:22 +0100 (CET) From: Andres Freund To: pgsql-bugs@postgresql.org, Simon Riggs Subject: Re: [PATCH] crash in 9.1's psql:describeOneTableDetails Date: Sat, 12 Feb 2011 15:39:19 +0100 User-Agent: KMail/1.13.6 (Linux/2.6.38-rc2-andres-00019-gd315777; KDE/4.6.0; x86_64; ; ) References: <201102101047.43254.andres@anarazel.de> <201102101050.38870.andres@anarazel.de> In-Reply-To: <201102101050.38870.andres@anarazel.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_XupVN+GtVQ+pvB5" Message-Id: <201102121539.20003.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/114 X-Sequence-Number: 29386 --Boundary-00=_XupVN+GtVQ+pvB5 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit On Thursday, February 10, 2011 10:50:38 AM Andres Freund wrote: > Hi, > > Sorry, I unfortunately had the wrong window focused when hitting enter... > > # \d category > > column number 2 is out of range 0..1 > > > > results in: > > > > Program received signal SIGSEGV, Segmentation fault. Ok, found the bug, simple oversight in invalid foreign key patch. Andres --Boundary-00=_XupVN+GtVQ+pvB5 Content-Type: text/x-patch; charset="UTF-8"; name="0001-Add-missing-version-check-to-psql.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Add-missing-version-check-to-psql.patch" =46rom 8100ae0d54138b08568e466b23032e740edc7f28 Mon Sep 17 00:00:00 2001 =46rom: Andres Freund Date: Sat, 12 Feb 2011 15:31:49 +0100 Subject: [PATCH] Add missing version check to psql 722bf701/"fk creation without validation" added display of invalidated constraints to psql - unfortunately the versioncheck for that only modified the query not the display of the query. So an invalid index access was made resulting in an SEGFAULT. =2D-- src/bin/psql/describe.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 884101a..735eef7 100644 *** a/src/bin/psql/describe.c =2D-- b/src/bin/psql/describe.c *************** describeOneTableDetails(const char *sche *** 1754,1760 **** PQgetvalue(result, i, 0), PQgetvalue(result, i, 1)); =20 ! if (strcmp(PQgetvalue(result, i, 2), "f") =3D=3D 0) appendPQExpBuffer(&buf, " NOT VALID"); =20 printTableAddFooter(&cont, buf.data); =2D-- 1754,1760 ---- PQgetvalue(result, i, 0), PQgetvalue(result, i, 1)); =20 ! if (pset.sversion >=3D 90100 && strcmp(PQgetvalue(result, i, 2), "f"= ) =3D=3D 0) appendPQExpBuffer(&buf, " NOT VALID"); =20 printTableAddFooter(&cont, buf.data); =2D-=20 1.7.3.rc1.5.g73aa2 --Boundary-00=_XupVN+GtVQ+pvB5--