2005-01-21 Francisco Figueiredo Jr. <fxjrlists@yahoo.com>
authorFrancisco Figueiredo Jr. <fxjr@mono-cvs.ximian.com>
Fri, 21 Jan 2005 01:41:51 +0000 (01:41 -0000)
committerFrancisco Figueiredo Jr. <fxjr@mono-cvs.ximian.com>
Fri, 21 Jan 2005 01:41:51 +0000 (01:41 -0000)
        * NpgsqlTypes/NpgsqlDbType.cs,
        NpgsqlTypes/NpgsqlTypesHelper.cs: Added support for Varchar datatype. Removed Internal data type enum. It is not supported yet.
        * Npgsql/PGUtil.cs,
        Npgsql/PGUtil.resx: (WriteString) Added support for logging what string is being written to database server.
        * Npgsql/NpgsqlCommand.cs: Added SingleRow behavior support.
        gborg 1099. Added support for record return type functions. Thanks neri and Michel for heads up and tests.
        Fixed record function bug when function had many parameters. Thanks Neri (neri at gborg dot postgresql dot org) for heads up.
        * Npgsql/NpgsqlCommandBuilder.cs,
        NpgsqlDataAdapter.cs: Applied patch to fix gborg 1095. Thanks Eric van der Gutten (ericvdg at ananzi dot co dot za).
        * Npgsql/NpgsqlDataReader.cs: Removed type conversions for GetXXX() methods.

svn path=/trunk/mcs/; revision=39297

mcs/class/Npgsql/ChangeLog
mcs/class/Npgsql/Npgsql/NpgsqlCommand.cs
mcs/class/Npgsql/Npgsql/NpgsqlCommandBuilder.cs
mcs/class/Npgsql/Npgsql/NpgsqlDataAdapter.cs
mcs/class/Npgsql/Npgsql/NpgsqlDataReader.cs
mcs/class/Npgsql/Npgsql/PGUtil.cs
mcs/class/Npgsql/Npgsql/PGUtil.resx
mcs/class/Npgsql/NpgsqlTypes/NpgsqlDbType.cs
mcs/class/Npgsql/NpgsqlTypes/NpgsqlTypesHelper.cs

index 79245e208cc01b342dee384acadef197d93164e7..f3c0b56d18c9ae0c066446f0eb3404beb102c990 100644 (file)
@@ -1,4 +1,21 @@
+
+2005-01-21  Francisco Figueiredo Jr.  <fxjrlists@yahoo.com>
+        * NpgsqlTypes/NpgsqlDbType.cs,
+        NpgsqlTypes/NpgsqlTypesHelper.cs: Added support for Varchar datatype. Removed Internal data type enum. It is not supported yet.
+        * Npgsql/PGUtil.cs,
+        Npgsql/PGUtil.resx: (WriteString) Added support for logging what string is being written to database server.
+        * Npgsql/NpgsqlCommand.cs: Added SingleRow behavior support. 
+        gborg 1099. Added support for record return type functions. Thanks neri and Michel for heads up and tests.
+        Fixed record function bug when function had many parameters. Thanks Neri (neri at gborg dot postgresql dot org) for heads up.
+        * Npgsql/NpgsqlCommandBuilder.cs,
+        NpgsqlDataAdapter.cs: Applied patch to fix gborg 1095. Thanks Eric van der Gutten (ericvdg at ananzi dot co dot za).
+        * Npgsql/NpgsqlDataReader.cs: Removed type conversions for GetXXX() methods.
+        
+        
+
 2004-12-20  Francisco Figueiredo Jr.  <fxjrlists@yahoo.com>
+        * Npgsql/NpgsqlCommand.cs: gborg 1099. Added support for record return type functions. Thanks neri and Michel for heads up and tests.
+        * Npgsql/NpgsqlDataReader.cs: Removed type conversions for GetXXX() methods.
         * Npgsql/NpgsqlCommand.cs: Added IClonable implementation. Also added strong type NpgsqlTransaction property and converted previous interface implementation to implicit interface implementation. Thanks Christopher Gersbo-Møller (cgm at knowledgelab dot sdu dot dk) for heads up.
         
 2004-12-19  Francisco Figueiredo Jr.  <fxjrlists@yahoo.com>
index 1a0d2d6f9e1b99883aaa6b2416a80d814cc3fbeb..1075cb3a07151cedc1178b715bb66b67717ea09d 100755 (executable)
@@ -737,10 +737,15 @@ namespace Npgsql
 
             Boolean addProcedureParenthesis = false;  // Do not add procedure parenthesis by default.
             
+            Boolean functionReturnsRecord = false;    // Functions don't return record by default.
+            
             String result = text;
 
             if (type == CommandType.StoredProcedure)
             {
+                
+                functionReturnsRecord = CheckFunctionReturnRecord();
+                
                 // Check if just procedure name was passed. If so, does not replace parameter names and just pass parameter values in order they were added in parameters collection.
                 if (!result.Trim().EndsWith(")"))  
                 {
@@ -751,16 +756,24 @@ namespace Npgsql
                 if (Connector.SupportsPrepare)
                     result = "select * from " + result; // This syntax is only available in 7.3+ as well SupportsPrepare.
                 else
-                    result = "select " + result;                               // Only a single result return supported. 7.2 and earlier.
+                    result = "select " + result;        //Only a single result return supported. 7.2 and earlier.
             }
             else if (type == CommandType.TableDirect)
-                return "select * from " + result; // There is no parameter support on table direct.
+                return "select * from " + result;       // There is no parameter support on table direct.
 
             if (parameters == null || parameters.Count == 0)
+            {
                 if (addProcedureParenthesis)
-                    return AddSingleRowBehaviorSupport(result + ")");
-                else
-                    return AddSingleRowBehaviorSupport(result);
+                        result += ")";
+                        
+                if (functionReturnsRecord)
+                    result = AddFunctionReturnsRecordSupport(result);
+                
+                
+                result = AddSingleRowBehaviorSupport(result);
+                                           
+                return result;
+             }   
 
 
             //CheckParameters();
@@ -787,14 +800,88 @@ namespace Npgsql
                                     Param.TypeInfo.ConvertToBackend(Param.Value, false)
                                 );
                     else
-                        result += Param.TypeInfo.ConvertToBackend(Param.Value, false);
+                        result += Param.TypeInfo.ConvertToBackend(Param.Value, false) + ",";
             }
             
+            
             if (addProcedureParenthesis)
+            {
+                // Remove a trailing comma added from parameter handling above. If any.
+                // Maybe there are only output parameters.
+                if (result.EndsWith(","))
+                    result = result.Remove(result.Length - 1, 1);
+                
                 result += ")";
+            }
 
+            if (functionReturnsRecord)
+                result = AddFunctionReturnsRecordSupport(result);
+                
             return AddSingleRowBehaviorSupport(result);
         }
+        
+        
+        
+        private Boolean CheckFunctionReturnRecord()
+        {
+        
+            if (Parameters.Count == 0)
+                return false;
+                
+            String returnRecordQuery = "select count(*) > 0 from pg_proc where prorettype = ( select oid from pg_type where typname = 'record' ) and proargtypes='{0}' and proname='{1}';";
+            
+            StringBuilder parameterTypes = new StringBuilder("");
+            
+            foreach(NpgsqlParameter p in Parameters)
+            {
+                if ((p.Direction == ParameterDirection.Input) ||
+                (p.Direction == ParameterDirection.InputOutput))
+                {
+                    parameterTypes.Append(Connection.Connector.OidToNameMapping[p.TypeInfo.Name].OID + " ");
+                }
+            }
+        
+                
+            NpgsqlCommand c = new NpgsqlCommand(String.Format(returnRecordQuery, parameterTypes.ToString(), CommandText), Connection);
+            
+            Boolean ret = (Boolean) c.ExecuteScalar();
+            
+            // reset any responses just before getting new ones
+            connector.Mediator.ResetResponses();
+            return ret;
+            
+        
+        }
+        
+        
+        private String AddFunctionReturnsRecordSupport(String OriginalResult)
+        {
+                                
+            StringBuilder sb = new StringBuilder(OriginalResult);
+            
+            sb.Append(" as (");
+            
+            foreach(NpgsqlParameter p in Parameters)
+            {
+                if ((p.Direction == ParameterDirection.Output) ||
+                (p.Direction == ParameterDirection.InputOutput))
+                {
+                    sb.Append(String.Format("{0} {1}, ", p.ParameterName.Substring(1), p.TypeInfo.Name));
+                }
+            }
+            
+            String result = sb.ToString();
+            
+            result = result.Remove(result.Length - 2, 1);
+            
+            result += ")";
+            
+            
+            
+            return result;
+            
+            
+        }
 
 
 
@@ -1008,20 +1095,22 @@ namespace Npgsql
         }//ReplaceParameterValue
         
         
-        private String AddSingleRowBehaviorSupport(String resultCommandText)
+        private String AddSingleRowBehaviorSupport(String ResultCommandText)
         {
+            
+            ResultCommandText = ResultCommandText.Trim();
         
             if ((commandBehavior & CommandBehavior.SingleRow) > 0)
             {
-                if (resultCommandText.EndsWith(";"))
-                    resultCommandText = resultCommandText.Substring(0, resultCommandText.Length - 1);
-                resultCommandText += " limit 1;";
+                if (ResultCommandText.EndsWith(";"))
+                    ResultCommandText = ResultCommandText.Substring(0, ResultCommandText.Length - 1);
+                ResultCommandText += " limit 1;";
                 
             }
             
             
             
-            return resultCommandText;
+            return ResultCommandText;
             
         }
 
index a0c68e71a9e3de6f4c663deaaefdfd9151ea2cb8..790f56878dec368aa34ea92e5d58e61c3ee3b64f 100644 (file)
@@ -27,6 +27,7 @@
 
 using System;
 using System.Data;
+using System.Data.Common;
 using System.ComponentModel;
 
 namespace Npgsql
@@ -37,6 +38,7 @@ namespace Npgsql
 
         bool disposed = false;
 
+
         private NpgsqlDataAdapter data_adapter;
         private NpgsqlCommand insert_command;
         private NpgsqlCommand update_command;
@@ -50,6 +52,7 @@ namespace Npgsql
         public NpgsqlCommandBuilder (NpgsqlDataAdapter adapter)
         {
             DataAdapter = adapter;
+            adapter.RowUpdating += new NpgsqlRowUpdatingEventHandler(OnRowUpdating);
         }
 
         public NpgsqlDataAdapter DataAdapter {
@@ -82,6 +85,44 @@ namespace Npgsql
             }
         }
 
+        private void OnRowUpdating(Object sender, NpgsqlRowUpdatingEventArgs value) {
+            switch (value.StatementType)
+            {
+                case StatementType.Insert:
+                    value.Command = GetInsertCommand(value.Row);
+                    break;
+                case StatementType.Update:
+                    value.Command = GetUpdateCommand(value.Row);
+                    break;
+                case StatementType.Delete:
+                    value.Command = GetDeleteCommand(value.Row);
+                    break;
+            }
+
+            DataColumnMappingCollection columnMappings = value.TableMapping.ColumnMappings;
+            foreach (IDataParameter parameter in value.Command.Parameters)
+            {
+
+                string dsColumnName = parameter.SourceColumn;
+                if (columnMappings.Contains(parameter.SourceColumn))
+                {
+                    DataColumnMapping mapping = columnMappings[parameter.SourceColumn];
+                    if (mapping != null)
+                    {
+                        dsColumnName = mapping.DataSetColumn;
+                    }
+                }
+
+                DataRowVersion rowVersion = DataRowVersion.Default;
+                if (value.StatementType == StatementType.Update)
+                    rowVersion = parameter.SourceVersion;
+                if (value.StatementType == StatementType.Delete)
+                    rowVersion = DataRowVersion.Original;
+                parameter.Value = value.Row [dsColumnName, rowVersion];
+            }
+            value.Row.AcceptChanges ();
+        }
+
         public string QuotePrefix {
             get
             {
index 02397261a1ca574f251b0e1dd783982c5b7a1a40..c5a7a111ab822e3d6783fb20715bed26734bd92b 100755 (executable)
@@ -3,11 +3,11 @@
 // Npgsql.NpgsqlDataAdapter.cs
 //
 // Author:
-//     Francisco Jr. (fxjrlists@yahoo.com.br)
+//  Francisco Jr. (fxjrlists@yahoo.com.br)
 //
-//     Copyright (C) 2002 The Npgsql Development Team
-//     npgsql-general@gborg.postgresql.org
-//     http://gborg.postgresql.org/project/npgsql/projdisplay.php
+//  Copyright (C) 2002 The Npgsql Development Team
+//  npgsql-general@gborg.postgresql.org
+//  http://gborg.postgresql.org/project/npgsql/projdisplay.php
 //
 //
 // This library is free software; you can redistribute it and/or
@@ -49,12 +49,10 @@ namespace Npgsql
     public sealed class NpgsqlDataAdapter : DbDataAdapter, IDbDataAdapter
     {
 
-        private NpgsqlCommand  _selectCommand;
-        private NpgsqlCommand          _updateCommand;
-        private NpgsqlCommand          _deleteCommand;
-        private NpgsqlCommand          _insertCommand;
-
-        private NpgsqlCommandBuilder cmd_builder;
+        private NpgsqlCommand       _selectCommand;
+        private NpgsqlCommand       _updateCommand;
+        private NpgsqlCommand       _deleteCommand;
+        private NpgsqlCommand       _insertCommand;
 
         // Log support
         private static readonly String CLASSNAME = "NpgsqlDataAdapter";
@@ -70,7 +68,6 @@ namespace Npgsql
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME);
             _selectCommand = selectCommand;
-            cmd_builder = new NpgsqlCommandBuilder(this);
         }
 
         public NpgsqlDataAdapter(String selectCommandText, NpgsqlConnection selectConnection) : this(new NpgsqlCommand(selectCommandText, selectConnection))
@@ -123,41 +120,6 @@ namespace Npgsql
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "OnRowUpdating");
             if ((RowUpdating != null) && (value is NpgsqlRowUpdatingEventArgs))
                 RowUpdating(this, (NpgsqlRowUpdatingEventArgs) value);
-
-            /*switch (value.StatementType)
-            {
-                case StatementType.Insert:
-                    value.Command = cmd_builder.GetInsertCommand(value.Row);
-                    break;
-                case StatementType.Update:
-                    value.Command = cmd_builder.GetUpdateCommand(value.Row);
-                    break;
-                case StatementType.Delete:
-                    value.Command = cmd_builder.GetDeleteCommand(value.Row);
-                    break;
-            }
-            DataColumnMappingCollection columnMappings = value.TableMapping.ColumnMappings;
-            foreach (IDataParameter parameter in value.Command.Parameters)
-            {
-
-                string dsColumnName = parameter.SourceColumn;
-                if (columnMappings.Contains(parameter.SourceColumn))
-                {
-                    DataColumnMapping mapping = columnMappings[parameter.SourceColumn];
-                    if (mapping != null)
-                    {
-                        dsColumnName = mapping.DataSetColumn;
-                    }
-                }
-                DataRowVersion rowVersion = DataRowVersion.Default;
-                if (value.StatementType == StatementType.Update)
-                    rowVersion = parameter.SourceVersion;
-                if (value.StatementType == StatementType.Delete)
-                    rowVersion = DataRowVersion.Original;
-                parameter.Value = value.Row [dsColumnName, rowVersion];
-            }
-            value.Row.AcceptChanges ();*/
-
         }
 
         ITableMappingCollection IDataAdapter.TableMappings
index 7c9a04ce0976cb44ea04b9debf232f4ba3342938..1594d87f22f0030aabb8ec53ba389e529a1aecd3 100755 (executable)
@@ -457,7 +457,7 @@ namespace Npgsql
         }
 
         /// <summary>
-        /// Gets the value of a column converted to a Boolean.
+        /// Gets the value of a column as Boolean.
         /// </summary>
         public Boolean GetBoolean(Int32 i)
         {
@@ -465,11 +465,11 @@ namespace Npgsql
             // and parsing from there?
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetBoolean");
 
-            return Convert.ToBoolean(GetValue(i));
+            return (Boolean) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to a Byte.  Not implemented.
+        /// Gets the value of a column as Byte.  Not implemented.
         /// </summary>
         public Byte GetByte(Int32 i)
         {
@@ -506,7 +506,7 @@ namespace Npgsql
         }
 
         /// <summary>
-        /// Gets the value of a column converted to a Char.  Not implemented.
+        /// Gets the value of a column as Char.  Not implemented.
         /// </summary>
         public Char GetChar(Int32 i)
         {
@@ -537,83 +537,83 @@ namespace Npgsql
         }
 
         /// <summary>
-        /// Gets the value of a column converted to Int16.
+        /// Gets the value of a column as Int16.
         /// </summary>
         public Int16 GetInt16(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetInt16");
 
-            return Convert.ToInt16(GetValue(i));
+            return (Int16) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to Int32.
+        /// Gets the value of a column as Int32.
         /// </summary>
         public Int32 GetInt32(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetInt32");
 
-            return Convert.ToInt32(GetValue(i));
+            return (Int32) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to Int64.
+        /// Gets the value of a column as Int64.
         /// </summary>
         public Int64 GetInt64(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetInt64");
 
-            return Convert.ToInt64(GetValue(i));
+            return (Int64) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to Single.
+        /// Gets the value of a column as Single.
         /// </summary>
         public Single GetFloat(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetFloat");
 
-            return Convert.ToSingle(GetValue(i));
+            return (Single) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to Double.
+        /// Gets the value of a column as Double.
         /// </summary>
         public Double GetDouble(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetDouble");
 
-            return Convert.ToDouble(GetValue(i));
+            return (Double) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to a String.
+        /// Gets the value of a column as String.
         /// </summary>
         public String GetString(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetString");
 
-            return Convert.ToString(GetValue(i));
+            return (String) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to Decimal.
+        /// Gets the value of a column as Decimal.
         /// </summary>
         public Decimal GetDecimal(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetDecimal");
 
-            return Convert.ToDecimal(GetValue(i));
+            return (Decimal) GetValue(i);
         }
 
         /// <summary>
-        /// Gets the value of a column converted to a DateTime.
+        /// Gets the value of a column as DateTime.
         /// </summary>
         public DateTime GetDateTime(Int32 i)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetDateTime");
 
-            return Convert.ToDateTime(GetValue(i));
+            return (DateTime) GetValue(i);
         }
 
         /// <summary>
index 2faad1bdd0c815ce5a7231eb2c84f5e28a2b4c04..63830c4487dbe97794f3100408aa2f585fb3354b 100755 (executable)
@@ -304,6 +304,8 @@ namespace Npgsql
         public static void WriteString(String the_string, Stream network_stream, Encoding encoding)
         {
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "WriteString");
+            
+            NpgsqlEventLog.LogMsg(resman, "Log_StringWritten", LogLevel.Debug, the_string);
 
             network_stream.Write(encoding.GetBytes(the_string + '\x00') , 0, encoding.GetByteCount(the_string) + 1);
         }
index e65597d9377d57e66a1889d2d268b94d285d44a6..794c3a407a10183c9904931334349803774420db 100644 (file)
@@ -57,7 +57,7 @@
     value   : The object must be serialized into a byte array 
             : using a System.ComponentModel.TypeConverter
             : and then encoded with base64 encoding.
-    -->\r
+    -->
        <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                <xsd:element name="root" msdata:IsDataSet="true">
                        <xsd:complexType>
        <data name="Log_StringRead">
                <value>String read: {0}.</value>
        </data>
+    <data name="Log_StringWritten">
+        <value>String written: {0}.</value>
+    </data>
     
 </root>
index fd77761808d5d6ae5ba13b69995a488561cf9a7e..56768b39c5418db8599e799e75fa8fc144635eac 100644 (file)
@@ -36,7 +36,6 @@ namespace NpgsqlTypes
         Date,
         Double,
         Integer,
-        Interval,
         Line,
         LSeg,
         Money,
@@ -48,7 +47,8 @@ namespace NpgsqlTypes
         Smallint,
         Text,
         Time,
-        Timestamp
+        Timestamp,
+       Varchar
 
     }
 
index b62ebb4a04f32f538cdb615c921fdf3c5c47532a..bb84f0b0b2758806415edeb67009a2e8d722b4b1 100755 (executable)
@@ -167,6 +167,8 @@ namespace NpgsqlTypes
                 NativeTypeMapping.AddDbTypeAlias("text", DbType.AnsiStringFixedLength);
                 NativeTypeMapping.AddTypeAlias("text", typeof(String));
 
+               NativeTypeMapping.AddType("varchar", NpgsqlDbType.Varchar, DbType.String, true, null);
+
                 NativeTypeMapping.AddType("bytea", NpgsqlDbType.Bytea, DbType.Binary, true,
                 new ConvertNativeToBackendHandler(BasicNativeToBackendTypeConverter.ToBinary));
 
@@ -220,13 +222,8 @@ namespace NpgsqlTypes
 
                 NativeTypeMapping.AddType("timestamp", NpgsqlDbType.Timestamp, DbType.DateTime, true,
                 new ConvertNativeToBackendHandler(BasicNativeToBackendTypeConverter.ToDateTime));
-                
-                NativeTypeMapping.AddTypeAlias("timestamp", typeof(DateTime));
-                
-                NativeTypeMapping.AddType("interval", NpgsqlDbType.Interval, DbType.DateTime, true,
-                new ConvertNativeToBackendHandler(BasicNativeToBackendTypeConverter.ToDateTime));
 
-                //NativeTypeMapping.AddTypeAlias("interval", typeof(DateTime));
+                NativeTypeMapping.AddTypeAlias("timestamp", typeof(DateTime));
 
                 NativeTypeMapping.AddType("point", NpgsqlDbType.Point, DbType.Object, true,
                 new ConvertNativeToBackendHandler(ExtendedNativeToBackendTypeConverter.ToPoint));
@@ -299,7 +296,7 @@ namespace NpgsqlTypes
                     new NpgsqlBackendTypeInfo(0, "bpchar", NpgsqlDbType.Text, DbType.String, typeof(String),
                         null),
 
-                    new NpgsqlBackendTypeInfo(0, "varchar", NpgsqlDbType.Text, DbType.String, typeof(String),
+                    new NpgsqlBackendTypeInfo(0, "varchar", NpgsqlDbType.Varchar, DbType.String, typeof(String),
                         null),
 
                     new NpgsqlBackendTypeInfo(0, "text", NpgsqlDbType.Text, DbType.String, typeof(String),
@@ -353,9 +350,6 @@ namespace NpgsqlTypes
 
                     new NpgsqlBackendTypeInfo(0, "timestamp", NpgsqlDbType.Timestamp, DbType.DateTime, typeof(DateTime),
                         new ConvertBackendToNativeHandler(BasicBackendToNativeTypeConverter.ToDateTime)),
-                    
-                    new NpgsqlBackendTypeInfo(0, "interval", NpgsqlDbType.Interval, DbType.DateTime, typeof(DateTime),
-                        new ConvertBackendToNativeHandler(BasicBackendToNativeTypeConverter.ToDateTime)),
 
                     new NpgsqlBackendTypeInfo(0, "timestamptz", NpgsqlDbType.Timestamp, DbType.DateTime, typeof(DateTime),
                         new ConvertBackendToNativeHandler(BasicBackendToNativeTypeConverter.ToDateTime)),