From: Andres Freund <andres@anarazel.de>
To: pgsql-bugs@postgresql.org
To: Simon Riggs <simon@2ndquadrant.com>
Subject: Re: [PATCH] crash in 9.1's psql:describeOneTableDetails
Date: Sat, 12 Feb 2011 15:39:19 +0100
Message-ID: <201102121539.20003.andres@anarazel.de> (raw)
In-Reply-To: <201102101050.38870.andres@anarazel.de>
References: <201102101047.43254.andres@anarazel.de>
<201102101050.38870.andres@anarazel.de>
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
Attachments:0001-Add-missing-version-check-to-psql.patch (text/x-patch, 1.3K) download
From 8100ae0d54138b08568e466b23032e740edc7f28 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
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.
---
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.cindex 884101a..735eef7 100644
*** a/src/bin/psql/describe.c
--- b/src/bin/psql/describe.c
*************** describeOneTableDetails(const char *sche
*** 1754,1760 ****
PQgetvalue(result, i, 0),
PQgetvalue(result, i, 1));
! if (strcmp(PQgetvalue(result, i, 2), "f") == 0)
appendPQExpBuffer(&buf, " NOT VALID");
printTableAddFooter(&cont, buf.data);
--- 1754,1760 ----
PQgetvalue(result, i, 0),
PQgetvalue(result, i, 1));
! if (pset.sversion >= 90100 && strcmp(PQgetvalue(result, i, 2), "f") == 0)
appendPQExpBuffer(&buf, " NOT VALID");
printTableAddFooter(&cont, buf.data);
--
1.7.3.rc1.5.g73aa2
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-bugs@postgresql.org
Cc: andres@anarazel.de, simon@2ndquadrant.com
Subject: Re: [PATCH] crash in 9.1's psql:describeOneTableDetails
In-Reply-To: <201102121539.20003.andres@anarazel.de>
References: <201102101047.43254.andres@anarazel.de> <201102101050.38870.andres@anarazel.de> <201102121539.20003.andres@anarazel.de>
* 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