From f0b8a79c4bea7bfa89245ee03abf994b027da411 Mon Sep 17 00:00:00 2001
From: Simon Riggs <simon@2ndQuadrant.com>
Date: Tue, 15 Feb 2011 00:08:15 +0000
Subject: [PATCH] Add version-sensitive SQL for psql when constraints NOT VALID
 Bug report and fix by Andres Freund

---
 src/bin/psql/describe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 884101aab18..735eef786b4 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1754,7 +1754,7 @@ describeOneTableDetails(const char *schemaname,
 									  PQgetvalue(result, i, 0),
 									  PQgetvalue(result, i, 1));
 
-					if (strcmp(PQgetvalue(result, i, 2), "f") == 0)
+					if (pset.sversion >= 90100 && strcmp(PQgetvalue(result, i, 2), "f") == 0)
 						appendPQExpBuffer(&buf, " NOT VALID");
 
 					printTableAddFooter(&cont, buf.data);
-- 
GitLab