bad typenames sent to postgresql server

From: "Scot Loach" <sloach(at)sandvine(dot)com>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: bad typenames sent to postgresql server
Date: 2004-10-04 21:10:40
Message-ID: A8535F8D62F3644997E91F4F66E341FC1BB328@exchange.sandvine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

I've recently updated my CVS, and I'm now getting parsing errors from the backend when I use a PREPARE statement with varchar in the types clause.
This seems to be because of the following changes made to pgtypes.c in version 1.63.

I looked at the postgresql parser, and sure enough, the varchar(), char() etc are not accepted.
Does anyone know what the intention of this change was? (the comment says "Map (var)char type to SQL type more properly")
Is this in fact a bug or am I missing something?

@@ -489,11 +502,11 @@ pgtype_to_name(StatementClass *stmt, Int
case PG_TYPE_INT8:
return "int8";
case PG_TYPE_NUMERIC:
- return "numeric";
+ return "numeric()";
case PG_TYPE_VARCHAR:
- return "varchar";
+ return "varchar()";
case PG_TYPE_BPCHAR:
- return "char";
+ return "char()";
case PG_TYPE_TEXT:
return "text";
case PG_TYPE_NAME:
@@ -515,10 +528,12 @@ pgtype_to_name(StatementClass *stmt, Int
case PG_TYPE_ABSTIME:
return "abstime";
case PG_TYPE_DATETIME:
- if (PG_VERSION_GE(conn, 7.0))
- return "timestamp with time zone";
- else
+ if (PG_VERSION_GT(conn, 7.1))
+ return "timestamptz";
+ else if (PG_VERSION_LT(conn, 7.0))
return "datetime";
+ else
+ return "timestamp";
case PG_TYPE_TIMESTAMP_NO_TMZONE:
return "timestamp without time zone";
case PG_TYPE_TIMESTAMP:

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2004-10-04 21:15:40 Schema support
Previous Message Dave Page 2004-10-04 19:56:42 Re: timestamp via odbc