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.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

