From 52aa7203209243afeeb26b21db924167a294fd0c Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Fri, 17 Nov 2000 19:57:48 +0000
Subject: [PATCH] Add separate type category for bit string types, allowing
 mixed bit/varbit function calls to work.

---
 src/backend/parser/parse_coerce.c | 8 ++++++--
 src/include/parser/parse_coerce.h | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index 131d65cbcd0..859d3547c5e 100644
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.49 2000/11/16 22:30:27 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.50 2000/11/17 19:57:47 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -458,7 +458,7 @@ TypeCategory(Oid inType)
 			 */
 		case (ZPBITOID):
 		case (VARBITOID):
-			result = STRING_TYPE;
+			result = BITSTRING_TYPE;
 			break;
 
 		case (OIDOID):
@@ -543,6 +543,10 @@ PreferredType(CATEGORY category, Oid type)
 			result = TEXTOID;
 			break;
 
+		case (BITSTRING_TYPE):
+			result = VARBITOID;
+			break;
+
 		case (NUMERIC_TYPE):
 			if (type == OIDOID)
 				result = OIDOID;
diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h
index 7dd95f5b47c..eb35cdec7ad 100644
--- a/src/include/parser/parse_coerce.h
+++ b/src/include/parser/parse_coerce.h
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: parse_coerce.h,v 1.24 2000/10/05 19:11:38 tgl Exp $
+ * $Id: parse_coerce.h,v 1.25 2000/11/17 19:57:48 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -23,6 +23,7 @@ typedef enum CATEGORY
 	UNKNOWN_TYPE,
 	BOOLEAN_TYPE,
 	STRING_TYPE,
+	BITSTRING_TYPE,
 	NUMERIC_TYPE,
 	DATETIME_TYPE,
 	TIMESPAN_TYPE,
-- 
GitLab