From: <fab...@us...> - 2008-07-22 22:44:06
|
Revision: 3651 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3651&view=rev Author: fabiomaulo Date: 2008-07-22 22:44:13 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Merge r3650 (fix NH-1390 by David Bachmann) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2008-07-22 22:41:57 UTC (rev 3650) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2008-07-22 22:44:13 UTC (rev 3651) @@ -2,6 +2,7 @@ using NHibernate.Cfg; using NHibernate.Dialect.Function; using NHibernate.SqlCommand; +using NHibernate.SqlTypes; namespace NHibernate.Dialect { @@ -137,5 +138,31 @@ { return ForUpdateString + " of " + aliases; } + + /// <summary>PostgreSQL supports UNION ALL clause</summary> + /// <remarks> + /// Reference: <see href="http://www.postgresql.org/docs/8.0/static/sql-select.html#SQL-UNION"> + /// PostgreSQL 8.0 UNION Clause documentation</see> + /// </remarks> + /// <value><see langword="true"/></value> + public override bool SupportsUnionAll + { + get { return true; } + } + + /// <summary>PostgreSQL requires to cast NULL values to correctly handle UNION/UNION ALL</summary> + /// <remarks> + /// See <see href="http://archives.postgresql.org/pgsql-bugs/2005-08/msg00239.php"> + /// PostgreSQL BUG #1847: Error in some kind of UNION query.</see> + /// </remarks> + /// <param name="sqlType">The <see cref="DbType"/> type code.</param> + /// <returns>null casted as <paramref name="sqlType"/>: "<c>null::sqltypename</c>"</returns> + public override string GetSelectClauseNullString(SqlType sqlType) + { + //This will cast 'null' with the full SQL type name, including eventual parameters. + //It shouldn't have any influence, but note that it's not mandatory. + //i.e. 'null::decimal(19, 2)', even if 'null::decimal' would be enough + return "null::" + GetTypeName(sqlType); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-02-06 16:44:14
|
Revision: 4059 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4059&view=rev Author: darioquintana Date: 2009-02-06 16:42:39 +0000 (Fri, 06 Feb 2009) Log Message: ----------- bug fixed: now it's contemplating scale and precision. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-02-06 14:58:31 UTC (rev 4058) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-02-06 16:42:39 UTC (rev 4059) @@ -45,6 +45,7 @@ RegisterColumnType(DbType.DateTime, "timestamp"); RegisterColumnType(DbType.Decimal, "decimal(19,5)"); RegisterColumnType(DbType.Decimal, 19, "decimal(18, $l)"); + RegisterColumnType(DbType.Decimal, 19, "decimal($p, $s)"); RegisterColumnType(DbType.Double, "float8"); RegisterColumnType(DbType.Int16, "int2"); RegisterColumnType(DbType.Int32, "int4"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-02-07 22:32:50
|
Revision: 4070 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4070&view=rev Author: darioquintana Date: 2009-02-07 22:32:27 +0000 (Sat, 07 Feb 2009) Log Message: ----------- - Bug fixes in Sequence support. - Preparing to support sequence-identity Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-02-07 21:16:36 UTC (rev 4069) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-02-07 22:32:27 UTC (rev 4070) @@ -85,9 +85,14 @@ public override string GetSequenceNextValString(string sequenceName) { - return string.Concat("select nextval ('", sequenceName, "')"); + return string.Concat("select ",GetSelectSequenceNextValString(sequenceName)); } + public override string GetSelectSequenceNextValString(string sequenceName) + { + return string.Concat("nextval ('", sequenceName, "')"); + } + public override string GetCreateSequenceString(string sequenceName) { return "create sequence " + sequenceName; @@ -98,6 +103,11 @@ return "drop sequence " + sequenceName; } + public override SqlString AddIdentifierOutParameterToInsert(SqlString insertString, string identifierColumnName, string parameterName) + { + return insertString.Append(" returning " + identifierColumnName); + } + public override bool SupportsSequences { get { return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-06-08 23:13:05
|
Revision: 4429 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4429&view=rev Author: darioquintana Date: 2009-06-08 23:12:35 +0000 (Mon, 08 Jun 2009) Log Message: ----------- Fix NH-1820 - PostgreSQL: support for Temporary Tables Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-06-07 23:03:14 UTC (rev 4428) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-06-08 23:12:35 UTC (rev 4429) @@ -175,5 +175,30 @@ //i.e. 'null::decimal(19, 2)', even if 'null::decimal' would be enough return "null::" + GetTypeName(sqlType); } + + public override bool SupportsTemporaryTables + { + get { return true; } + } + + /*public override bool DropTemporaryTableAfterUse() + { + //we have to, because postgres sets current tx + //to rollback only after a failed create table + return true; + }*/ + + public override string CreateTemporaryTableString + { + get { return "create temporary table"; } + } + + public override string CreateTemporaryTablePostfix + { + get + { + return "on commit drop"; + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2010-08-04 11:54:32
|
Revision: 5105 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5105&view=rev Author: fabiomaulo Date: 2010-08-04 11:54:24 +0000 (Wed, 04 Aug 2010) Log Message: ----------- Fix NH-2268 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2010-08-03 13:04:37 UTC (rev 5104) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2010-08-04 11:54:24 UTC (rev 5105) @@ -63,6 +63,10 @@ RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as varchar)")); RegisterFunction("locate", new PositionSubstringFunction()); RegisterFunction("iif", new SQLFunctionTemplate(null, "case when ?1 then ?2 else ?3 end")); + + RegisterFunction("substring", new AnsiSubstringFunction()); + RegisterFunction("replace", new StandardSQLFunction("replace", NHibernateUtil.String)); + DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.NpgsqlDriver"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2010-11-02 10:56:49
|
Revision: 5257 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5257&view=rev Author: fabiomaulo Date: 2010-11-02 10:56:42 +0000 (Tue, 02 Nov 2010) Log Message: ----------- Fix NH-1897 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2010-11-02 07:02:17 UTC (rev 5256) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2010-11-02 10:56:42 UTC (rev 5257) @@ -207,5 +207,10 @@ return "on commit drop"; } } + + public override string ToBooleanValueString(bool value) + { + return value ? "TRUE" : "FALSE"; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |