Add compatiblity information for bytea.
authorBruce Momjian <bruce@momjian.us>
Mon, 20 Mar 2000 04:02:47 +0000 (04:02 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 20 Mar 2000 04:02:47 +0000 (04:02 +0000)
src/backend/parser/parse_coerce.c
src/backend/utils/adt/selfuncs.c
src/include/c.h
src/include/parser/parse_coerce.h

index 35312eaadf07a696543b2209987ed092d4b19cd3..8ff54677ef695db66012609b4e0eff1cafcaaaac 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.37 2000/03/19 00:15:39 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.38 2000/03/20 04:02:45 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -129,7 +129,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId,
        /* safety check that we got the right thing */
        if (exprType(result) != targetTypeId)
            elog(ERROR, "coerce_type: conversion function %s produced %s",
-                typeTypeName(targetType), 
+                typeTypeName(targetType),
                 typeidTypeName(exprType(result)));
 
        /*
@@ -320,6 +320,7 @@ TypeCategory(Oid inType)
        case (NAMEOID):
        case (BPCHAROID):
        case (VARCHAROID):
+   case (BYTEAOID):
        case (TEXTOID):
        case (LZTEXTOID):
            result = STRING_TYPE;
@@ -550,6 +551,7 @@ PromoteLesserType(Oid inType1, Oid inType2, Oid *newType1, Oid *newType2)
                {
                    case (BPCHAROID):
                    case (VARCHAROID):
+           case (BYTEAOID):
                    case (TEXTOID):
 
                    case (INT2OID):
@@ -614,6 +616,7 @@ PromoteLesserType(Oid inType1, Oid inType2, Oid *newType1, Oid *newType2)
            {
                case (BPCHAROID):
                case (VARCHAROID):
+       case (BYTEA):
                case (TEXTOID):
 
                case (INT2OID):
index ff5ec332ea2fa950e6aee86970368b321f2eb789..76211e688b9ee8780c1acbc9811e767adaca1292 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.57 2000/02/26 23:03:12 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.58 2000/03/20 04:02:45 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -536,6 +536,7 @@ convert_to_scalar(Datum value, Oid typid,
        }
        case BPCHAROID:
        case VARCHAROID:
+   case BYTEA:
        case TEXTOID:
            if (VARSIZE(DatumGetPointer(value)) > VARHDRSZ)
            {
@@ -595,7 +596,7 @@ convert_to_scalar(Datum value, Oid typid,
            return true;
        case TINTERVALOID:
        {
-           TimeInterval    interval = (TimeInterval) DatumGetPointer(value);
+           TimeInterval    interval = (TimeInterval) DatumGetPointer(value);
 
            if (interval->status != 0)
            {
index fb51e5011c3f5f49dc9c0254da5e63ecbe1215b5..ea96d87b911de1efb8c5b690fca2e28ce34f6c7c 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: c.h,v 1.65 2000/03/19 22:08:51 tgl Exp $
+ * $Id: c.h,v 1.66 2000/03/20 04:02:46 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -673,8 +673,10 @@ extern int assertTest(int val);
  * overhead.
  *
  * We got the 64 number by testing this against the stock memset() on
- * BSD/OS 3.0. Larger values were slower.  (I think the crossover point
- * could be a good deal higher for most platforms, actually --- tgl)
+ * BSD/OS 3.0. Larger values were slower.  bjm 1997/09/11
+ *
+ *  I think the crossover point could be a good deal higher for
+ * most platforms, actually.  tgl 2000-03-19
  */
 #define MemSet(start, val, len) \
    do \
index d0acd944e116df7b87646a4d3cc4f9d39b2caf38..0549386a397a76c8ba1655cd88424de210e8f2b8 100644 (file)
@@ -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.19 2000/03/14 23:06:48 thomas Exp $
+ * $Id: parse_coerce.h,v 1.20 2000/03/20 04:02:47 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -45,6 +45,7 @@ typedef enum CATEGORY
        || ((t) == BPCHAROID) \
        || ((t) == VARCHAROID) \
        || ((t) == TEXTOID) \
+       || ((t) == BYTEAOID) \
        || ((t) == INT4OID) \
        || ((t) == INT8OID) \
        || ((t) == FLOAT8OID) \
@@ -81,10 +82,16 @@ typedef enum CATEGORY
 #define IS_BINARY_COMPATIBLE(a,b) \
          (((a) == BPCHAROID && (b) == TEXTOID) \
        || ((a) == BPCHAROID && (b) == VARCHAROID) \
+       || ((a) == BPCHAROID && (b) == BYTEAOID) \
        || ((a) == VARCHAROID && (b) == TEXTOID) \
        || ((a) == VARCHAROID && (b) == BPCHAROID) \
+       || ((a) == VARCHAROID && (b) == BYTEAOID) \
        || ((a) == TEXTOID && (b) == BPCHAROID) \
        || ((a) == TEXTOID && (b) == VARCHAROID) \
+       || ((a) == TEXTOID && (b) == BYTEAOID) \
+       || ((a) == BYTEAOID && (b) == BPCHAROID) \
+       || ((a) == BYTEAOID && (b) == VARCHAROID) \
+       || ((a) == BYTEAOID && (b) == TEXTOID) \
        || ((a) == OIDOID && (b) == INT4OID) \
        || ((a) == OIDOID && (b) == REGPROCOID) \
        || ((a) == INT4OID && (b) == OIDOID) \