From 6b06ff04f412319e3d86b090caf8f47da3430f00 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Tue, 17 Apr 2018 18:04:04 +0700
Subject: [PATCH] Remove historical hard-coded quoting rules

This also allows us to skip checking for '_null_'. Since the previous
commit caused all minus-signs to be quoted, removing oprname from the
quoting rules is a no-op.

In passing, remove check for whitespace, since it's redundant with the
check for non-word characters.
---
 src/backend/catalog/genbki.pl | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 25522fa..2d63907 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -667,19 +667,8 @@ sub print_bki_insert
 		$bki_value = '' if $bki_value eq '\0';
 
 		$bki_value = sprintf(qq'"%s"', $bki_value)
-		  if  $bki_value ne '_null_'
-		  and $bki_value !~ /^"[^"]+"$/
+		  if $bki_value !~ /^"[^"]+"$/        # Not already quoted
 		  and ( length($bki_value) == 0       # Empty string
-				or $bki_value =~ /\s/         # Contains whitespace
-
-				# To preserve historical formatting, operator names are
-				# always quoted. Likewise for values of multi-element types,
-				# even if they only contain a single element.
-				or $attname eq 'oprname'
-				or $atttype eq 'oidvector'
-				or $atttype eq 'int2vector'
-				or $atttype =~ /\[\]$/
-
 				or ($bki_value =~ /\W/));     # Contains non-word characters
 
 		push @bki_values, $bki_value;
-- 
2.7.4

