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

From 8100ae0d54138b08568e466b23032e740edc7f28 Mon Sep 17 00:00:00 2001
From: Andres Freund <and...@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.c
index 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

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to