Make postgres prompt backend>, and remove PARSEDEBUG.
authorBruce Momjian
Sat, 22 May 1999 02:55:58 +0000 (02:55 +0000)
committerBruce Momjian
Sat, 22 May 1999 02:55:58 +0000 (02:55 +0000)
src/backend/parser/parse_clause.c
src/backend/parser/parse_coerce.c
src/backend/tcop/postgres.c

index a3eafab36cbee8697d9f172d6d212fbacca2d889..f7b6f2219d12830918f14b7577b7e20a0a68be80 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.34 1999/05/17 18:22:18 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.35 1999/05/22 02:55:57 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -161,10 +161,6 @@ transformUsingClause(ParseState *pstate, List *onList, char *lname, char *rname)
            Attr       *rattr = makeAttr(rname, i->name);
            A_Expr *e = makeNode(A_Expr);
 
-#ifdef PARSEDEBUG
-printf("transformUsingClause- transform %s", nodeToString(i));
-#endif
-
            e->oper = OP;
            e->opname = "=";
            e->lexpr = (Node *)lattr;
@@ -199,16 +195,7 @@ printf("transformUsingClause- transform %s", nodeToString(i));
            {
                expr = (A_Expr *)qual;
            }
-
-#ifdef PARSEDEBUG
-printf("transformUsingClause- transform %s", nodeToString(qual));
-#endif
-
        }
-
-#ifdef PARSEDEBUG
-printf(" to %s\n", nodeToString(expr));
-#endif
    }
    return ((Node *)transformExpr(pstate, (Node *)expr, EXPR_COLUMN_FIRST));
 }
index 70cb970a50ec3b87ef75881d2fb5b67e6e7ab295..a3a93f17f1a1b0858551755eab16b29b79658f89 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.13 1999/05/19 16:46:12 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.14 1999/05/22 02:55:57 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -41,18 +41,8 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
    Oid         infunc;
    Datum       val;
 
-#ifdef PARSEDEBUG
-   printf("coerce_type: argument types are %d -> %u\n",
-        inputTypeId, targetTypeId);
-#endif
-
    if (targetTypeId == InvalidOid)
-   {
-#ifdef PARSEDEBUG
-       printf("coerce_type: apparent NULL target argument; suppress type conversion\n");
-#endif
        result = node;
-   }
    else if (inputTypeId != targetTypeId)
    {
 
@@ -61,13 +51,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
         * through...
         */
        if (IS_BINARY_COMPATIBLE(inputTypeId, targetTypeId))
-       {
-#ifdef PARSEDEBUG
-           printf("coerce_type: argument type %s is known to be convertible to type %s\n",
-             typeidTypeName(inputTypeId), typeidTypeName(targetTypeId));
-#endif
            result = node;
-       }
 
        /*
         * if not unknown input type, try for explicit conversion using
@@ -84,18 +68,10 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
            n->funcname = typeidTypeName(targetTypeId);
            n->args = lcons(node, NIL);
 
-#ifdef PARSEDEBUG
-           printf("coerce_type: construct function %s(%s)\n",
-             typeidTypeName(targetTypeId), typeidTypeName(inputTypeId));
-#endif
-
            result = transformExpr(pstate, (Node *) n, EXPR_COLUMN_FIRST);
        }
        else
        {
-#ifdef PARSEDEBUG
-           printf("coerce_type: node is UNKNOWN type\n");
-#endif
            if (nodeTag(node) == T_Const)
            {
                Const      *con = (Const *) node;
@@ -117,22 +93,11 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Oid targetTypeId)
                result = (Node *) con;
            }
            else
-           {
-#ifdef PARSEDEBUG
-               printf("coerce_type: should never get here!\n");
-#endif
                result = node;
-           }
        }
    }
    else
-   {
-#ifdef PARSEDEBUG
-       printf("coerce_type: argument type IDs %u match\n", inputTypeId);
-#endif
-
        result = node;
-   }
 
    return result;
 }  /* coerce_type() */
@@ -163,10 +128,6 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
    /* run through argument list... */
    for (i = 0; i < nargs; i++)
    {
-#ifdef PARSEDEBUG
-       printf("can_coerce_type: argument #%d types are %u -> %u\n",
-              i, input_typeids[i], func_typeids[i]);
-#endif
        if (input_typeids[i] != func_typeids[i])
        {
 
@@ -175,31 +136,14 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
             * through...
             */
            if (IS_BINARY_COMPATIBLE(input_typeids[i], func_typeids[i]))
-           {
-#ifdef PARSEDEBUG
-               printf("can_coerce_type: argument #%d type %s is known to be convertible to type %s\n",
-                      i, typeidTypeName(input_typeids[i]), typeidTypeName(func_typeids[i]));
-#endif
-           }
+               ;
 
            /* don't know what to do for the output type? then quit... */
            else if (func_typeids[i] == InvalidOid)
-           {
-#ifdef PARSEDEBUG
-               printf("can_coerce_type: output OID func_typeids[%u] is zero\n", i);
-#endif
                return false;
-           }
-
            /* don't know what to do for the input type? then quit... */
            else if (input_typeids[i] == InvalidOid)
-           {
-#ifdef PARSEDEBUG
-               printf("can_coerce_type: input OID input_typeids[%u] is zero\n", i);
-#endif
                return false;
-           }
-
            /*
             * if not unknown input type, try for explicit conversion
             * using functions...
@@ -223,51 +167,13 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
                 * should also check the function return type just to be
                 * safe...
                 */
-               if (HeapTupleIsValid(ftup))
-               {
-#ifdef PARSEDEBUG
-                   printf("can_coerce_type: found function %s(%s) to convert argument #%d\n",
-                          typeidTypeName(func_typeids[i]), typeidTypeName(input_typeids[i]), i);
-#endif
-               }
-               else
-               {
-#ifdef PARSEDEBUG
-                   printf("can_coerce_type: did not find function %s(%s) to convert argument #%d\n",
-                          typeidTypeName(func_typeids[i]), typeidTypeName(input_typeids[i]), i);
-#endif
+               if (!HeapTupleIsValid(ftup))
                    return false;
-               }
-           }
-           else
-           {
-#ifdef PARSEDEBUG
-               printf("can_coerce_type: argument #%d type is %u (UNKNOWN)\n",
-                      i, input_typeids[i]);
-#endif
            }
 
            tp = typeidType(input_typeids[i]);
            if (typeTypeFlag(tp) == 'c')
-           {
-#ifdef PARSEDEBUG
-               printf("can_coerce_type: typeTypeFlag for %s is 'c'\n",
-                      typeidTypeName(input_typeids[i]));
-#endif
                return false;
-           }
-
-#ifdef PARSEDEBUG
-           printf("can_coerce_type: conversion from %s to %s is possible\n",
-                  typeidTypeName(input_typeids[i]), typeidTypeName(func_typeids[i]));
-#endif
-       }
-       else
-       {
-#ifdef PARSEDEBUG
-           printf("can_coerce_type: argument #%d type IDs %u match\n",
-                  i, input_typeids[i]);
-#endif
        }
    }
 
@@ -396,9 +302,6 @@ PreferredType(CATEGORY category, Oid type)
            result = UNKNOWNOID;
            break;
    }
-#ifdef PARSEDEBUG
-   printf("PreferredType- (%d) preferred type is %s\n", category, typeidTypeName(result));
-#endif
    return result;
 }  /* PreferredType() */
 
index 53f8f9186978d95e291058e228003ed808a99d98..dbf0c0b9850211a8d04736e713b5df4b3fbd197d 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.113 1999/05/13 07:28:46 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.114 1999/05/22 02:55:58 momjian Exp $
  *
  * NOTES
  *   this is the "main" module of the postgres backend and
@@ -215,7 +215,7 @@ InteractiveBackend(char *inBuf)
     *  display a prompt and obtain input from the user
     * ----------------
     */
-   printf("> ");
+   printf("backend> ");
    fflush(stdout);
 
    for (;;)
@@ -1485,7 +1485,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
    if (!IsUnderPostmaster)
    {
        puts("\nPOSTGRES backend interactive interface ");
-       puts("$Revision: 1.113 $ $Date: 1999/05/13 07:28:46 $\n");
+       puts("$Revision: 1.114 $ $Date: 1999/05/22 02:55:58 $\n");
    }
 
    /* ----------------