pgsqlclient-checkins Mailing List for PostgreSqlClient (Page 2)
Status: Inactive
Brought to you by:
carlosga_fb
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(120) |
Aug
(95) |
Sep
(95) |
Oct
(213) |
Nov
(114) |
Dec
(64) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(6) |
Feb
(134) |
Mar
(88) |
Apr
(28) |
May
(22) |
Jun
(15) |
Jul
(23) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(6) |
Dec
|
2005 |
Jan
(8) |
Feb
(6) |
Mar
|
Apr
(42) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(84) |
Apr
(46) |
May
(40) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <car...@us...> - 2006-05-19 11:12:22
|
Revision: 152 Author: carlosga_fb Date: 2006-05-19 04:12:11 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=152&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatementStatus.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-19 11:11:31 UTC (rev 151) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-19 11:12:11 UTC (rev 152) @@ -171,7 +171,10 @@ { try { - // Clear actual row list + // Update status + this.status = PgStatementStatus.Parsing; + + // Clear actual row list this.rows = null; this.rowIndex = 0; @@ -216,7 +219,10 @@ lock (this.db) { try - { + { + // Update status + this.status = PgStatementStatus.Describing; + string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); @@ -292,6 +298,9 @@ { try { + // Update status + this.status = PgStatementStatus.Binding; + PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); // Destination portal name @@ -318,7 +327,7 @@ packet.Write((short)this.rowDescriptor.Fields.Length); for (int i = 0; i < this.rowDescriptor.Fields.Length; i++) { - packet.Write((short)this.rowDescriptor.Fields[i].FormatCode); + packet.Write((short)this.rowDescriptor.Fields[i].DataType.FormatCode); } // Send packet to the server @@ -343,6 +352,9 @@ { try { + // Update status + this.status = PgStatementStatus.Executing; + PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); packet.WriteNullString(this.PortalName); @@ -398,6 +410,9 @@ { try { + // Update status + this.status = PgStatementStatus.Executing; + PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); // Function id @@ -445,14 +460,17 @@ } } - public void Query() - { - ArrayList innerRows = new ArrayList(); + public void Query() + { + ArrayList innerRows = new ArrayList(); - lock (this.db) - { + lock (this.db) + { try { + // Update Status + this.status = PgStatementStatus.OnQuery; + PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); packet.WriteNullString(this.stmtText); @@ -460,9 +478,6 @@ // Send packet to the server this.db.SendPacket(packet, PgFrontEndCodes.QUERY); - // Update Status - this.status = PgStatementStatus.OnQuery; - // Set fetch size this.fetchSize = 1; @@ -509,43 +524,40 @@ // reset fetch size this.fetchSize = 200; } - } - } + } + } - public object[] FetchRow() - { - object[] row = null; + public object[] FetchRow() + { + object[] row = null; - if ((!this.allRowsFetched && this.rows == null) || - (!this.allRowsFetched && this.rows.Length == 0) || - (!this.allRowsFetched && this.rowIndex >= this.fetchSize)) - { - lock (this) - { - // Retrieve next group of rows - this.Execute(); - } - } - - if (this.rows != null && - this.rows.Length > 0 && - this.rows[this.rowIndex] != null) - { - // Return always first row - row = (object[])this.rows[this.rowIndex++]; - } + if ((!this.allRowsFetched && this.rows == null) || + (!this.allRowsFetched && this.rows.Length == 0) || + (!this.allRowsFetched && this.rowIndex >= this.fetchSize)) + { + lock (this) + { + // Retrieve next group of rows + this.Execute(); + } + } - if (this.rows != null && - (this.rowIndex >= this.fetchSize || - this.rowIndex >= this.rows.Length || - this.rows[this.rowIndex] == null)) - { - this.rows = null; - } + if (this.rows != null && + this.rows.Length > 0 && + this.rows[this.rowIndex] != null) + { + // Return always first row + row = (object[])this.rows[this.rowIndex++]; + } - return row; - } + if (this.rows != null && (this.rowIndex >= this.rows.Length || this.rows[this.rowIndex] == null)) + { + this.rows = null; + } + return row; + } + public void Close() { this.Close('S'); @@ -774,7 +786,14 @@ break; default: - if (this.rowDescriptor.Fields[i].FormatCode == PgTypeFormat.Text) + PgTypeFormat formatCode = this.rowDescriptor.Fields[i].DataType.FormatCode; + + if (this.status == PgStatementStatus.OnQuery) + { + formatCode = this.rowDescriptor.Fields[i].FormatCode; + } + + if (formatCode == PgTypeFormat.Text) { values[i] = packet.ReadValueFromString(this.rowDescriptor.Fields[i].DataType, length); } Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatementStatus.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatementStatus.cs 2006-05-19 11:11:31 UTC (rev 151) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatementStatus.cs 2006-05-19 11:12:11 UTC (rev 152) @@ -22,9 +22,13 @@ internal enum PgStatementStatus { Initial, + Parsing, Parsed, + Describing, Described, + Binding, Binded, + Executing, Executed, OnQuery, Error This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-19 11:11:37
|
Revision: 151 Author: carlosga_fb Date: 2006-05-19 04:11:31 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=151&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs 2006-05-19 09:23:05 UTC (rev 150) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs 2006-05-19 11:11:31 UTC (rev 151) @@ -205,10 +205,7 @@ string portalName = String.Format("PR{0}", statementName); this.statement = this.connection.InternalConnection.Database.CreateStatement(prepareName, portalName, sql); - this.statement.Parse(); - this.statement.Describe(); - this.statement.Bind(); - this.statement.Execute(); + this.statement.Query(); // Allow the DataReader to process more refcursors hasMoreResults = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-19 09:23:12
|
Revision: 150 Author: carlosga_fb Date: 2006-05-19 02:23:05 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=150&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgColumns.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctions.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgColumns.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgColumns.cs 2006-05-19 09:22:36 UTC (rev 149) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgColumns.cs 2006-05-19 09:23:05 UTC (rev 150) @@ -24,7 +24,7 @@ { internal class PgColumns : PgSchema { - #region \xB7 Methods \xB7 + #region \xB7 Protected Methods \xB7 protected override string BuildSql(string[] restrictions) { Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs 2006-05-19 09:22:36 UTC (rev 149) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs 2006-05-19 09:23:05 UTC (rev 150) @@ -16,6 +16,8 @@ */ using System; +using System.Data; +using PostgreSql.Data.PostgreSqlClient; namespace PostgreSql.Data.Schema { @@ -31,10 +33,16 @@ "current_database() AS FUNCTION_CATALOG, " + "pg_namespace.nspname AS FUNCTION_SCHEMA, " + "pg_proc.proname AS FUNCTION_NAME, " + + "null AS PARAMETER_NAME, " + + "null AS DATA_TYPE, " + + "0 AS PARAMETER_DIRECTION, " + + "pg_proc.pronargs AS ARGUMENT_NUMBER, " + + "pg_proc.proallargtypes AS ARGUMENT_TYPES, " + + "pg_proc.proargmodes AS ARGUMENT_MODES, " + + "pg_proc.proargnames AS ARGUMENT_NAMES " + "FROM " + "pg_proc " + - "left join pg_namespace ON pg_proc.pronamespace = pg_namespace.oid " + - "left join pg_description ON pg_proc.oid = pg_description.objoid "; + "left join pg_namespace ON pg_proc.pronamespace = pg_namespace.oid "; if (restrictions != null && restrictions.Length > 0) { @@ -60,13 +68,13 @@ { where += " and "; } - where += String.Format(" and pg_proc.proname = '{0}'", restrictions[2]); + where += String.Format(" pg_proc.proname = '{0}'", restrictions[2]); } } if (where.Length > 0) { - sql += "WHERE " + where; + sql += " WHERE " + where; } sql += " ORDER BY pg_namespace.nspname, pg_proc.proname"; @@ -74,6 +82,61 @@ return sql; } + protected override DataTable ProcessResult(PgConnection connection, DataTable schema) + { + DataTable functionParameters = schema.Clone(); + + functionParameters.BeginLoadData(); + + foreach (DataRow row in schema.Rows) + { + int argNumber = Convert.ToInt32(row["ARGUMENT_NUMBER"]); + Array argTypes = (Array)row["ARGUMENT_TYPES"]; + Array argNames = (Array)row["ARGUMENT_NAMES"]; + + if (!Convert.ToBoolean(row["RETURNS_SET"])) + { + DataRow functionParameter = functionParameters.NewRow(); + + // Create the new foreign key column info + functionParameter["FUNCTION_CATALOG"] = row["FUNCTION_CATALOG"]; + functionParameter["FUNCTION_SCHEMA"] = row["FUNCTION_SCHEMA"]; + functionParameter["FUNCTION_NAME"] = row["FUNCTION_NAME"]; + functionParameter["PARAMETER_NAME"] = "result"; + functionParameter["DATA_TYPE"] = ""; + functionParameter["PARAMETER_DIRECTION"] = (Int32)ParameterDirection.Output; + + functionParameters.Rows.Add(functionParameter); + } + + for (int i = 0; i < argNumber; i++) + { + DataRow functionParameter = functionParameters.NewRow(); + + // Create the new foreign key column info + functionParameter["FUNCTION_CATALOG"] = row["FUNCTION_CATALOG"]; + functionParameter["FUNCTION_SCHEMA"] = row["FUNCTION_SCHEMA"]; + functionParameter["FUNCTION_NAME"] = row["FUNCTION_NAME"]; + functionParameter["PARAMETER_NAME"] = (string)argNames.GetValue(i + 1); + functionParameter["DATA_TYPE"] = ""; + functionParameter["PARAMETER_DIRECTION"]= (Int32)ParameterDirection.Input; + + functionParameters.Rows.Add(functionParameter); + } + } + + functionParameters.EndLoadData(); + functionParameters.AcceptChanges(); + + functionParameters.Columns.Remove("RETURNS_SET"); + functionParameters.Columns.Remove("ARGUMENT_NUMBER"); + functionParameters.Columns.Remove("ARGUMENT_TYPES"); + functionParameters.Columns.Remove("ARGUMENT_MODES"); + functionParameters.Columns.Remove("ARGUMENT_NAMES"); + + return functionParameters; + } + #endregion } } Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctions.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctions.cs 2006-05-19 09:22:36 UTC (rev 149) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctions.cs 2006-05-19 09:23:05 UTC (rev 150) @@ -41,10 +41,7 @@ "when 'v' THEN 'VOLATILE' " + "END AS VOLATILE, " + "pg_proc.proretset AS RETURNS_SET, " + - "pg_proc.prorettype AS RETURN_TYPE, " + "pg_proc.pronargs AS ARGUMENT_NUMBER, " + - "pg_proc.proargtypes AS ARGUMENT_TYPES, " + - "pg_proc.proargtypes AS ARGUMENT_NAMES, " + "pg_proc.prosrc AS SOURCE, " + "pg_description.description AS DESCRIPTION " + "FROM " + @@ -77,7 +74,7 @@ { where += " and "; } - where += String.Format(" and pg_proc.proname = '{0}'", restrictions[2]); + where += String.Format(" pg_proc.proname = '{0}'", restrictions[2]); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-19 09:22:42
|
Revision: 149 Author: carlosga_fb Date: 2006-05-19 02:22:36 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=149&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-19 09:22:07 UTC (rev 148) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-19 09:22:36 UTC (rev 149) @@ -77,6 +77,7 @@ DataTypes.Add(829 , "macaddr" , PgDataType.VarChar , 0, PgTypeFormat.Text, 6); DataTypes.Add(869 , "inet" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); DataTypes.Add(1000 , "_bool" , PgDataType.Array , 16, PgTypeFormat.Binary, 1); + DataTypes.Add(1002 , "_char" , PgDataType.Array , 18, PgTypeFormat.Binary, 0); DataTypes.Add(1005 , "_int2" , PgDataType.Array , 21, PgTypeFormat.Binary, 2); DataTypes.Add(1007 , "_int4" , PgDataType.Array , 23, PgTypeFormat.Binary, 4); DataTypes.Add(1009 , "_text" , PgDataType.Array , 25, PgTypeFormat.Binary, 0); Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-19 09:22:07 UTC (rev 148) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-19 09:22:36 UTC (rev 149) @@ -473,16 +473,15 @@ public object ReadValueFromString(PgType type, int length) { + if (type.IsArray) + { + return this.ReadStringArray(type, length); + } + string stringValue = this.ReadString(length); switch (type.DataType) { - case PgDataType.Array: - return null; - - case PgDataType.Vector: - return null; - case PgDataType.Binary: return null; @@ -601,7 +600,7 @@ PgType elementType = PgDatabase.DataTypes[type.ElementType]; Array data = null; - string contents = ReadString(length); + string contents = this.ReadString(length); contents = contents.Substring(1, contents.Length - 2); string[] elements = contents.Split(','); Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-19 09:22:07 UTC (rev 148) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-19 09:22:36 UTC (rev 149) @@ -103,6 +103,21 @@ } } + public bool IsArray + { + get + { + bool returnValue = false; + + if (this.dataType == PgDataType.Array) + { + returnValue = true; + } + + return returnValue; + } + } + public bool IsLong { get This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-19 09:22:13
|
Revision: 148 Author: carlosga_fb Date: 2006-05-19 02:22:07 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=148&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommandBuilder.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommandBuilder.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommandBuilder.cs 2006-05-19 08:36:12 UTC (rev 147) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommandBuilder.cs 2006-05-19 09:22:07 UTC (rev 148) @@ -18,6 +18,7 @@ using System; using System.Data; using System.Data.Common; +using System.Globalization; using System.Text; using System.ComponentModel; @@ -32,6 +33,92 @@ /// <include file='Doc/en_EN/FbCommandBuilder.xml' path='doc/class[@name="FbCommandBuilder"]/method[@name="DeriveParameters(PgCommand)"]/*'/> public static void DeriveParameters(PgCommand command) { + if (command.CommandType != CommandType.StoredProcedure) + { + throw new InvalidOperationException("The command text is not a valid stored procedure name."); + } + + string originalSpName = command.CommandText.Trim(); + string schemaName = ""; + string spName = ""; + string quotePrefix = "\""; + string quoteSuffix = "\""; + + if (originalSpName.Contains(".")) + { + string[] parts = originalSpName.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries); + + if (parts.Length > 2) + { + throw new InvalidOperationException("The command stored procedure name is not valid."); + } + + schemaName = parts[0]; + spName = parts[1]; + } + else + { + spName = originalSpName; + } + + if (schemaName.StartsWith(quotePrefix) && schemaName.EndsWith(quoteSuffix)) + { + schemaName = schemaName.Substring(1, spName.Length - 2); + } + else + { + schemaName = schemaName.ToUpper(CultureInfo.CurrentUICulture); + } + + if (spName.StartsWith(quotePrefix) && spName.EndsWith(quoteSuffix)) + { + spName = spName.Substring(1, spName.Length - 2); + } + else + { + spName = spName.ToUpper(CultureInfo.CurrentUICulture); + } + + string paramsText = String.Empty; + + command.Parameters.Clear(); + + DataView dataTypes = command.Connection.GetSchema("DataTypes").DefaultView; + + DataTable spSchema = command.Connection.GetSchema( + "FunctionParameters", new string[] { null, schemaName, spName }); + + int count = 1; + foreach (DataRow row in spSchema.Rows) + { + dataTypes.RowFilter = String.Format( + CultureInfo.CurrentUICulture, + "TypeName = '{0}'", + row["PARAMETER_DATA_TYPE"]); + + PgParameter parameter = command.Parameters.Add( + "@" + row["PARAMETER_NAME"].ToString().Trim(), + PgDbType.VarChar); + + parameter.PgDbType = (PgDbType)dataTypes[0]["ProviderDbType"]; + parameter.Direction = (ParameterDirection)row["PARAMETER_DIRECTION"]; + parameter.Size = Convert.ToInt32(row["PARAMETER_SIZE"], CultureInfo.InvariantCulture); + + if (parameter.PgDbType == PgDbType.Decimal || + parameter.PgDbType == PgDbType.Numeric) + { + if (row["NUMERIC_PRECISION"] != DBNull.Value) + { + parameter.Precision = Convert.ToByte(row["NUMERIC_PRECISION"], CultureInfo.InvariantCulture); + } + if (row["NUMERIC_SCALE"] != DBNull.Value) + { + parameter.Scale = Convert.ToByte(row["NUMERIC_SCALE"], CultureInfo.InvariantCulture); + } + } + + count++; + } } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-19 08:36:20
|
Revision: 147 Author: carlosga_fb Date: 2006-05-19 01:36:12 -0700 (Fri, 19 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=147&view=rev Log Message: ----------- Updated data types schema Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml 2006-05-18 19:52:22 UTC (rev 146) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/MetaData.xml 2006-05-19 08:36:12 UTC (rev 147) @@ -1,1188 +1,1213 @@ <?xml version="1.0" standalone="yes"?> <NewDataSet> - <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xs:element name="NewDataSet" msdata:IsDataSet="true"> - <xs:complexType> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="MetaDataCollections" msdata:MinimumCapacity="9"> - <xs:complexType> - <xs:sequence> - <xs:element name="CollectionName" type="xs:string" minOccurs="0" /> - <xs:element name="NumberOfRestrictions" type="xs:int" minOccurs="0" /> - <xs:element name="NumberOfIdentifierParts" type="xs:int" minOccurs="0" /> - <xs:element name="PopulationMechanism" type="xs:string" minOccurs="0" /> - <xs:element name="PopulationString" type="xs:string" minOccurs="0" /> - <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> - <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="Restrictions" msdata:MinimumCapacity="3"> - <xs:complexType> - <xs:sequence> - <xs:element name="CollectionName" type="xs:string" minOccurs="0" /> - <xs:element name="RestrictionName" type="xs:string" minOccurs="0" /> - <xs:element name="RestrictionDefault" type="xs:string" minOccurs="0" /> - <xs:element name="RestrictionNumber" type="xs:int" minOccurs="0" /> - <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> - <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="DataSourceInformation" msdata:MinimumCapacity="18"> - <xs:complexType> - <xs:sequence> - <xs:element name="CompositeIdentifierSeparatorPattern" type="xs:string" minOccurs="0" /> - <xs:element name="DataSourceProductName" type="xs:string" minOccurs="0" /> - <xs:element name="DataSourceProductVersion" type="xs:string" minOccurs="0" /> - <xs:element name="DataSourceProductVersionNormalized" type="xs:string" minOccurs="0" /> - <xs:element name="GroupByBehavior" msdata:DataType="System.Data.Common.GroupByBehavior, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> - <xs:element name="IdentifierPattern" type="xs:string" minOccurs="0" /> - <xs:element name="IdentifierCase" msdata:DataType="System.Data.Common.IdentifierCase, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> - <xs:element name="OrderByColumnsInSelect" type="xs:boolean" minOccurs="0" /> - <xs:element name="ParameterMarkerFormat" type="xs:string" minOccurs="0" /> - <xs:element name="ParameterMarkerPattern" type="xs:string" minOccurs="0" /> - <xs:element name="ParameterNameMaxLength" type="xs:int" minOccurs="0" /> - <xs:element name="ParameterNamePattern" type="xs:string" minOccurs="0" /> - <xs:element name="QuotedIdentifierPattern" type="xs:string" minOccurs="0" /> - <xs:element name="QuotedIdentifierCase" msdata:DataType="System.Data.Common.IdentifierCase, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> - <xs:element name="StatementSeparatorPattern" type="xs:string" minOccurs="0" /> - <xs:element name="StringLiteralPattern" type="xs:string" minOccurs="0" /> - <xs:element name="SupportedJoinOperators" msdata:DataType="System.Data.Common.SupportedJoinOperators, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="DataTypes" msdata:MinimumCapacity="18"> - <xs:complexType> - <xs:sequence> - <xs:element name="TypeName" type="xs:string" minOccurs="0" /> - <xs:element name="ProviderDbType" type="xs:int" minOccurs="0" /> - <xs:element name="ColumnSize" type="xs:long" minOccurs="0" /> - <xs:element name="CreateFormat" type="xs:string" minOccurs="0" /> - <xs:element name="CreateParameters" type="xs:string" minOccurs="0" /> - <xs:element name="DataType" type="xs:string" minOccurs="0" /> - <xs:element name="IsAutoIncrementable" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsBestMatch" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsCaseSensitive" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsFixedLength" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsFixedPrecisionScale" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsLong" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsNullable" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsSearchable" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsSearchableWithLike" type="xs:boolean" minOccurs="0" /> - <xs:element name="IsUnsigned" type="xs:boolean" minOccurs="0" /> - <xs:element name="MaximumScale" type="xs:short" minOccurs="0" /> - <xs:element name="MinimumScale" type="xs:short" minOccurs="0" /> - <xs:element name="IsConcurrencyType" type="xs:boolean" minOccurs="0" /> - <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> - <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> - <xs:element name="IsLiteralSupported" type="xs:boolean" minOccurs="0" /> - <xs:element name="LiteralPrefix" type="xs:string" minOccurs="0" /> - <xs:element name="LiteralSuffix" type="xs:string" minOccurs="0" /> - <xs:element name="DbType" type="xs:int" minOccurs="0" /> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="ReservedWords" msdata:MinimumCapacity="3"> - <xs:complexType> - <xs:sequence> - <xs:element name="ReservedWord" type="xs:string" minOccurs="0" /> - <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> - <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:choice> - </xs:complexType> - </xs:element> - </xs:schema> - <MetaDataCollections> - <CollectionName>Aggregates</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT pg_aggregate.aggfnoid AS AGGREGATE_FUNCTION, pg_aggregate.aggtransfn AS TRANSITION_FUNCTION, pg_aggregate.aggfinalfn AS FINAL_FUNCTION, pg_aggregate.agginitval AS INITIAL_VALUE, pg_type.typname AS BASE_TYPE FROM pg_aggregate left join pg_type ON pg_aggregate.aggtranstype = pg_type.oid ORDER BY pg_aggregate.aggfnoid</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Casts</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT pg_typesrc.typname AS SOURCE_TYPE, pg_typetgt.typname AS TARGET_TYPE, pg_namespace.nspname AS FUNCTION_SCHEMA, pg_proc.proname AS FUNCTION_NAME, case pg_cast.castcontext when 'e' THEN 'EXPLICIT' when 'a' THEN 'ASSIGNMENT' when 'i' THEN 'EXPRESSIONS' END AS CAST_CONTEXT FROM pg_cast left join pg_type as pg_typesrc ON pg_cast.castsource = pg_typesrc.oid left join pg_type as pg_typetgt ON pg_cast.casttarget = pg_typetgt.oid left join pg_proc ON pg_cast.castfunc = pg_proc.oid left join pg_namespace ON pg_proc.pronamespace = pg_namespace.oid ORDER BY pg_proc.proname</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>CheckConstraints</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Columns</CollectionName> - <NumberOfRestrictions>4</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Databases</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT pg_database.datname AS DATABASE_NAME, pg_database.datistemplate AS IS_TEMPLATE, pg_database.datallowconn AS ALLOW_CONNECTION, pg_database.datconfig AS DATABASE_CONFIG FROM pg_database</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>DataSourceInformation</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>DataTable</PopulationMechanism> - <PopulationString>DataSourceInformation</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>DataTypes</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>DataTable</PopulationMechanism> - <PopulationString>DataTypes</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>ForeignKeys</CollectionName> - <NumberOfRestrictions>4</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>ForeignKeyColumns</CollectionName> - <NumberOfRestrictions>5</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Functions</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>FunctionParameters</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Groups</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT pg_group.groname AS GROUP_NAME, pg_group.grolist AS GROUP_USERS FROM pg_group ORDER BY pg_group.groname</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Indexes</CollectionName> - <NumberOfRestrictions>4</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>IndexColumns</CollectionName> - <NumberOfRestrictions>5</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>MetaDataCollections</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>DataTable</PopulationMechanism> - <PopulationString>MetaDataCollections</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>PrimaryKeys</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>ReservedWords</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>DataTable</PopulationMechanism> - <PopulationString>ReservedWords</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Restrictions</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>DataTable</PopulationMechanism> - <PopulationString>Restrictions</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Schemas</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT current_database() AS SCHEMA_CATALOG, pg_namespace.nspname AS SCHEMA_NAME, pg_shadow.usename AS SCHEMA_OWNER, pg_description.description AS DESCRIPTION, CASE WHEN nspname LIKE 'pg\\_temp\\_%%' THEN 1 WHEN (nspname LIKE 'pg\\_%' OR nspname = 'information_schema') THEN 0 ELSE 3 END AS SCHEMA_TYPE FROM pg_namespace left join pg_shadow ON pg_namespace.nspowner = pg_shadow.usesysid left join pg_description ON pg_namespace.oid = pg_description.objoid ORDER BY pg_namespace.nspname, pg_shadow.usename</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Sequences</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>SqlLanguages</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT pg_language.lanname AS LANGUAGE_NAME, pg_language.lanispl AS IS_USER_DEFINED, pg_proc.proname AS CALL_FUNCTION, pg_procv.proname AS VALIDATOR, pg_description.description AS DESCRIPTION FROM pg_language left join pg_proc ON pg_language.lanplcallfoid = pg_proc.oid left join pg_proc as pg_procv ON pg_language.lanvalidator = pg_procv.oid left join pg_description ON pg_language.oid = pg_description.objoid ORDER BY pg_language.lanname</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Tables</CollectionName> - <NumberOfRestrictions>5</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>TableConstraints</CollectionName> - <NumberOfRestrictions>7</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>TableSpaces</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT spcname as TABLESPACE_NAME from pg_tablespace</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Triggers</CollectionName> - <NumberOfRestrictions>4</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>UniqueKeys</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Users</CollectionName> - <NumberOfRestrictions>0</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>SQLCommand</PopulationMechanism> - <PopulationString>SELECT pg_shadow.usename AS USER_NAME, pg_shadow.usecreatedb AS CREATE_DATABASE, pg_shadow.usesuper AS IS_SUPERUSER, pg_shadow.usecatupd AS UPDATE_SYSCATALOGS, pg_shadow.passwd AS PASSWORD, pg_shadow.useconfig AS CONFIGURATION FROM pg_shadow ORDER BY pg_shadow.usename</PopulationString> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>Views</CollectionName> - <NumberOfRestrictions>3</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <MetaDataCollections> - <CollectionName>ViewColumns</CollectionName> - <NumberOfRestrictions>4</NumberOfRestrictions> - <NumberOfIdentifierParts>0</NumberOfIdentifierParts> - <PopulationMechanism>PrepareCollection</PopulationMechanism> - </MetaDataCollections> - <Restrictions> - <CollectionName>CheckConstraints</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>constraint_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>CheckConstraints</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>constraint_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>CheckConstraints</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>constraint_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Columns</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Columns</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Columns</CollectionName> - <RestrictionName>Table</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Columns</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>column_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Indexes</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Indexes</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Indexes</CollectionName> - <RestrictionName>TableName</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Indexes</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>index_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>IndexColumns</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>IndexColumns</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>IndexColumns</CollectionName> - <RestrictionName>TableName</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>IndexColumns</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>index_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>IndexColumns</CollectionName> - <RestrictionName>ColumnName</RestrictionName> - <RestrictionDefault>column_name</RestrictionDefault> - <RestrictionNumber>5</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Functions</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>function_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Functions</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>function_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Functions</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>function_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>FunctionParameters</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>function_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>FunctionParameters</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>function_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>FunctionParameters</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>function_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeys</CollectionName> - <RestrictionName>ConstraintCatalog</RestrictionName> - <RestrictionDefault>constraint_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeys</CollectionName> - <RestrictionName>ConstraintSchema</RestrictionName> - <RestrictionDefault>constraint_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeys</CollectionName> - <RestrictionName>TableName</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeys</CollectionName> - <RestrictionName>ConstraintName</RestrictionName> - <RestrictionDefault>constraint_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeyColumns</CollectionName> - <RestrictionName>ConstraintCatalog</RestrictionName> - <RestrictionDefault>constraint_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeyColumns</CollectionName> - <RestrictionName>ConstraintSchema</RestrictionName> - <RestrictionDefault>constraint_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeyColumns</CollectionName> - <RestrictionName>TableName</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeyColumns</CollectionName> - <RestrictionName>ConstraintName</RestrictionName> - <RestrictionDefault>constraint_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ForeignKeyColumns</CollectionName> - <RestrictionName>ColumnName</RestrictionName> - <RestrictionDefault>column_name</RestrictionDefault> - <RestrictionNumber>5</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>PrimaryKeys</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>PrimaryKeys</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>PrimaryKeys</CollectionName> - <RestrictionName>Table</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Sequences</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>sequence_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Sequences</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>sequence_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Sequences</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>sequence_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Tables</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Tables</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Tables</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Tables</CollectionName> - <RestrictionName>Type</RestrictionName> - <RestrictionDefault>table_type</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Tables</CollectionName> - <RestrictionName>Tablespace</RestrictionName> - <RestrictionDefault>tablespace</RestrictionDefault> - <RestrictionNumber>5</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Triggers</CollectionName> - <RestrictionName>TableCatalog</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Triggers</CollectionName> - <RestrictionName>TableSchema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Triggers</CollectionName> - <RestrictionName>TableName</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Triggers</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>trigger_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>UniqueKeys</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>UniqueKeys</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>table_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>UniqueKeys</CollectionName> - <RestrictionName>Table</RestrictionName> - <RestrictionDefault>table_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Views</CollectionName> - <RestrictionName>Catalog</RestrictionName> - <RestrictionDefault>view_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Views</CollectionName> - <RestrictionName>Schema</RestrictionName> - <RestrictionDefault>view_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>Views</CollectionName> - <RestrictionName>Name</RestrictionName> - <RestrictionDefault>view_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ViewColumns</CollectionName> - <RestrictionName>ViewCatalog</RestrictionName> - <RestrictionDefault>view_catalog</RestrictionDefault> - <RestrictionNumber>1</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ViewColumns</CollectionName> - <RestrictionName>ViewSchema</RestrictionName> - <RestrictionDefault>view_schema</RestrictionDefault> - <RestrictionNumber>2</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ViewColumns</CollectionName> - <RestrictionName>ViewName</RestrictionName> - <RestrictionDefault>view_name</RestrictionDefault> - <RestrictionNumber>3</RestrictionNumber> - </Restrictions> - <Restrictions> - <CollectionName>ViewColumns</CollectionName> - <RestrictionName>ColumnName</RestrictionName> - <RestrictionDefault>column_name</RestrictionDefault> - <RestrictionNumber>4</RestrictionNumber> - </Restrictions> - <DataSourceInformation> - <CompositeIdentifierSeparatorPattern>.</CompositeIdentifierSeparatorPattern> - <DataSourceProductName>PostgreSQL</DataSourceProductName> - <DataSourceProductVersion>7.4+</DataSourceProductVersion> - <DataSourceProductVersionNormalized>7.4+</DataSourceProductVersionNormalized> - <GroupByBehavior>2</GroupByBehavior> - <IdentifierPattern>(^\[\p{Lo}\p{Lu}\p{Ll}_@#][\p{Lo}\p{Lu}\p{Ll}\p{Nd}@$#_]*$)|(^\[[^\]\0]|\]\]+\]$)|(^\"[^\"\0]|\"\"+\"$)</IdentifierPattern> - <IdentifierCase>2</IdentifierCase> - <OrderByColumnsInSelect>true</OrderByColumnsInSelect> - <ParameterMarkerFormat>{0}</ParameterMarkerFormat> - <ParameterMarkerPattern>@[\p{Lo}\p{Lu}\p{Ll}\p{Lm}_@#][\p{Lo}\p{Lu}\p{Ll}\p{Lm}\p{Nd}\uff3f_@#\$]*(?=\s+|$)</ParameterMarkerPattern> - <ParameterNameMaxLength>128</ParameterNameMaxLength> - <ParameterNamePattern>^[\p{Lo}\p{Lu}\p{Ll}\p{Lm}_@#][\p{Lo}\p{Lu}\p{Ll}\p{Lm}\p{Nd}\uff3f_@#\$]*(?=\s+|$)</ParameterNamePattern> - <QuotedIdentifierPattern>(([^\""|\"\")*)</QuotedIdentifierPattern> - <QuotedIdentifierCase>2</QuotedIdentifierCase> - <StatementSeparatorPattern>;</StatementSeparatorPattern> - <StringLiteralPattern>'(([^']|'')*)'</StringLiteralPattern> - <SupportedJoinOperators>15</SupportedJoinOperators> - </DataSourceInformation> - <DataTypes> - <TypeName>int2</TypeName> - <ProviderDbType>12</ProviderDbType> - <ColumnSize>2</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Int16</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>10</DbType> - </DataTypes> - <DataTypes> - <TypeName>int4</TypeName> - <ProviderDbType>13</ProviderDbType> - <ColumnSize>4</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Int32</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>11</DbType> - </DataTypes> - <DataTypes> - <TypeName>int8</TypeName> - <ProviderDbType>14</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Int64</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>12</DbType> - </DataTypes> - <DataTypes> - <TypeName>decimal</TypeName> - <ProviderDbType>9</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters>precision, scale</CreateParameters> - <DataType>System.Decimal</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>7</DbType> - </DataTypes> - <DataTypes> - <TypeName>numeric</TypeName> - <ProviderDbType>18</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters>precision, scale</CreateParameters> - <DataType>System.Decimal</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>7</DbType> - </DataTypes> - <DataTypes> - <TypeName>float4</TypeName> - <ProviderDbType>11</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Single</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>15</DbType> - </DataTypes> - <DataTypes> - <TypeName>float8</TypeName> - <ProviderDbType>10</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Single</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>8</DbType> - </DataTypes> - <DataTypes> - <TypeName>currency</TypeName> - <ProviderDbType>7</ProviderDbType> - <ColumnSize>4</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Single</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>true</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>15</DbType> - </DataTypes> - <DataTypes> - <TypeName>char</TypeName> - <ProviderDbType>5</ProviderDbType> - <ColumnSize>2147483647</ColumnSize> - <CreateFormat /> - <CreateParameters>length</CreateParameters> - <DataType>System.String</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>true</IsLiteralSupported> - <LiteralPrefix>'</LiteralPrefix> - <LiteralSuffix>'</LiteralSuffix> - <DbType>16</DbType> - </DataTypes> - <DataTypes> - <TypeName>varchar</TypeName> - <ProviderDbType>27</ProviderDbType> - <ColumnSize>2147483647</ColumnSize> - <CreateFormat /> - <CreateParameters>length</CreateParameters> - <DataType>System.String</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>true</IsLiteralSupported> - <LiteralPrefix>'</LiteralPrefix> - <LiteralSuffix>'</LiteralSuffix> - <DbType>16</DbType> - </DataTypes> - <DataTypes> - <TypeName>text</TypeName> - <ProviderDbType>22</ProviderDbType> - <ColumnSize>2147483647</ColumnSize> - <CreateFormat /> - <CreateParameters>length</CreateParameters> - <DataType>System.String</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>true</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>true</IsLiteralSupported> - <LiteralPrefix>'</LiteralPrefix> - <LiteralSuffix>'</LiteralSuffix> - <DbType>16</DbType> - </DataTypes> - <DataTypes> - <TypeName>bytea</TypeName> - <ProviderDbType>1</ProviderDbType> - <ColumnSize>2147483647</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Byte[]</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>true</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>1</DbType> - </DataTypes> - <DataTypes> - <TypeName>date</TypeName> - <ProviderDbType>8</ProviderDbType> - <ColumnSize>4</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.DateTime</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>6</DbType> - </DataTypes> - <DataTypes> - <TypeName>time</TypeName> - <ProviderDbType>23</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.DateTime</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>6</DbType> - </DataTypes> - <DataTypes> - <TypeName>timetz</TypeName> - <ProviderDbType>24</ProviderDbType> - <ColumnSize>12</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.DateTime</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>6</DbType> - </DataTypes> - <DataTypes> - <TypeName>timestamp</TypeName> - <ProviderDbType>25</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.DateTime</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>6</DbType> - </DataTypes> - <DataTypes> - <TypeName>timestamptz</TypeName> - <ProviderDbType>26</ProviderDbType> - <ColumnSize>8</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.DateTime</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>6</DbType> - </DataTypes> - <DataTypes> - <TypeName>interval</TypeName> - <ProviderDbType>15</ProviderDbType> - <ColumnSize>12</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Timespan</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>6</DbType> - </DataTypes> - <DataTypes> - <TypeName>bool</TypeName> - <ProviderDbType>2</ProviderDbType> - <ColumnSize>1</ColumnSize> - <CreateFormat /> - <CreateParameters/> - <DataType>System.Boolean</DataType> - <IsAutoIncrementable>false</IsAutoIncrementable> - <IsBestMatch>false</IsBestMatch> - <IsCaseSensitive>false</IsCaseSensitive> - <IsFixedLength>false</IsFixedLength> - <IsFixedPrecisionScale>false</IsFixedPrecisionScale> - <IsLong>false</IsLong> - <IsNullable>true</IsNullable> - <IsSearchable>true</IsSearchable> - <IsSearchableWithLike>true</IsSearchableWithLike> - <IsUnsigned>false</IsUnsigned> - <MaximumScale>0</MaximumScale> - <MinimumScale>0</MinimumScale> - <IsConcurrencyType>false</IsConcurrencyType> - <IsLiteralSupported>false</IsLiteralSupported> - <LiteralPrefix/> - <LiteralSuffix/> - <DbType>3</DbType> - </DataTypes> - <ReservedWords> - <ReservedWord>ABORT</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>ABORT</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>ANALYZE</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>BINARY</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>CLUSTER</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>CONSTRAINT</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>COPY</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>EXPLAIN</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>EXTEND</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>LISTEN</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>LOAD</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>LOCK</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>MOVE</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>NEW</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>NONE</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>NOTIFY</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>OFFSET</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>RESET</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>SETOF</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>SHOW</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>UNLISTEN</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>UNTIL</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>VACUUM</ReservedWord> - </ReservedWords> - <ReservedWords> - <ReservedWord>VERBOSE</ReservedWord> - </ReservedWords> + <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xs:element name="NewDataSet" msdata:IsDataSet="true"> + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="MetaDataCollections" msdata:MinimumCapacity="9"> + <xs:complexType> + <xs:sequence> + <xs:element name="CollectionName" type="xs:string" minOccurs="0" /> + <xs:element name="NumberOfRestrictions" type="xs:int" minOccurs="0" /> + <xs:element name="NumberOfIdentifierParts" type="xs:int" minOccurs="0" /> + <xs:element name="PopulationMechanism" type="xs:string" minOccurs="0" /> + <xs:element name="PopulationString" type="xs:string" minOccurs="0" /> + <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> + <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Restrictions" msdata:MinimumCapacity="3"> + <xs:complexType> + <xs:sequence> + <xs:element name="CollectionName" type="xs:string" minOccurs="0" /> + <xs:element name="RestrictionName" type="xs:string" minOccurs="0" /> + <xs:element name="RestrictionDefault" type="xs:string" minOccurs="0" /> + <xs:element name="RestrictionNumber" type="xs:int" minOccurs="0" /> + <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> + <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="DataSourceInformation" msdata:MinimumCapacity="18"> + <xs:complexType> + <xs:sequence> + <xs:element name="CompositeIdentifierSeparatorPattern" type="xs:string" minOccurs="0" /> + <xs:element name="DataSourceProductName" type="xs:string" minOccurs="0" /> + <xs:element name="DataSourceProductVersion" type="xs:string" minOccurs="0" /> + <xs:element name="DataSourceProductVersionNormalized" type="xs:string" minOccurs="0" /> + <xs:element name="GroupByBehavior" msdata:DataType="System.Data.Common.GroupByBehavior, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> + <xs:element name="IdentifierPattern" type="xs:string" minOccurs="0" /> + <xs:element name="IdentifierCase" msdata:DataType="System.Data.Common.IdentifierCase, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> + <xs:element name="OrderByColumnsInSelect" type="xs:boolean" minOccurs="0" /> + <xs:element name="ParameterMarkerFormat" type="xs:string" minOccurs="0" /> + <xs:element name="ParameterMarkerPattern" type="xs:string" minOccurs="0" /> + <xs:element name="ParameterNameMaxLength" type="xs:int" minOccurs="0" /> + <xs:element name="ParameterNamePattern" type="xs:string" minOccurs="0" /> + <xs:element name="QuotedIdentifierPattern" type="xs:string" minOccurs="0" /> + <xs:element name="QuotedIdentifierCase" msdata:DataType="System.Data.Common.IdentifierCase, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> + <xs:element name="StatementSeparatorPattern" type="xs:string" minOccurs="0" /> + <xs:element name="StringLiteralPattern" type="xs:string" minOccurs="0" /> + <xs:element name="SupportedJoinOperators" msdata:DataType="System.Data.Common.SupportedJoinOperators, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="DataTypes" msdata:MinimumCapacity="18"> + <xs:complexType> + <xs:sequence> + <xs:element name="TypeName" type="xs:string" minOccurs="0" /> + <xs:element name="ProviderDbType" type="xs:int" minOccurs="0" /> + <xs:element name="ColumnSize" type="xs:long" minOccurs="0" /> + <xs:element name="CreateFormat" type="xs:string" minOccurs="0" /> + <xs:element name="CreateParameters" type="xs:string" minOccurs="0" /> + <xs:element name="DataType" type="xs:string" minOccurs="0" /> + <xs:element name="IsAutoIncrementable" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsBestMatch" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsCaseSensitive" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsFixedLength" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsFixedPrecisionScale" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsLong" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsNullable" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsSearchable" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsSearchableWithLike" type="xs:boolean" minOccurs="0" /> + <xs:element name="IsUnsigned" type="xs:boolean" minOccurs="0" /> + <xs:element name="MaximumScale" type="xs:short" minOccurs="0" /> + <xs:element name="MinimumScale" type="xs:short" minOccurs="0" /> + <xs:element name="IsConcurrencyType" type="xs:boolean" minOccurs="0" /> + <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> + <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> + <xs:element name="IsLiteralSupported" type="xs:boolean" minOccurs="0" /> + <xs:element name="LiteralPrefix" type="xs:string" minOccurs="0" /> + <xs:element name="LiteralSuffix" type="xs:string" minOccurs="0" /> + <xs:element name="DbType" type="xs:int" minOccurs="0" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ReservedWords" msdata:MinimumCapacity="3"> + <xs:complexType> + <xs:sequence> + <xs:element name="ReservedWord" type="xs:string" minOccurs="0" /> + <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" /> + <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" /> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:choice> + </xs:complexType> + </xs:element> + </xs:schema> + <MetaDataCollections> + <CollectionName>Aggregates</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + <PopulationMechanism>SQLCommand</PopulationMechanism> + <PopulationString>SELECT pg_aggregate.aggfnoid AS AGGREGATE_FUNCTION, pg_aggregate.aggtransfn AS TRANSITION_FUNCTION, pg_aggregate.aggfinalfn AS FINAL_FUNCTION, pg_aggregate.agginitval AS INITIAL_VALUE, pg_type.typname AS BASE_TYPE FROM pg_aggregate left join pg_type ON pg_aggregate.aggtranstype = pg_type.oid ORDER BY pg_aggregate.aggfnoid</PopulationString> + </MetaDataCollections> + <MetaDataCollections> + <CollectionName>Casts</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + <PopulationMechanism>SQLCommand</PopulationMechanism> + <PopulationString>SELECT pg_typesrc.typname AS SOURCE_TYPE, pg_typetgt.typname AS TARGET_TYPE, pg_namespace.nspname AS FUNCTION_SCHEMA, pg_proc.proname AS FUNCTION_NAME, case pg_cast.castcontext when 'e' THEN 'EXPLICIT' when 'a' THEN 'ASSIGNMENT' when 'i' THEN 'EXPRESSIONS' END AS CAST_CONTEXT FROM pg_cast left join pg_type as pg_typesrc ON pg_cast.castsource = pg_typesrc.oid left join pg_type as pg_typetgt ON pg_cast.casttarget = pg_typetgt.oid left join pg_proc ON pg_cast.castfunc = pg_proc.oid left join pg_namespace ON pg_proc.pronamespace = pg_namespace.oid ORDER BY pg_proc.proname</PopulationString> + </MetaDataCollections> + <MetaDataCollections> + <CollectionName>CheckConstraints</CollectionName> + <NumberOfRestri... [truncated message content] |
From: <car...@us...> - 2006-05-18 19:52:28
|
Revision: 146 Author: carlosga_fb Date: 2006-05-18 12:52:22 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=146&view=rev Log Message: ----------- Initial support for refcursos returned on StoredProcedure calls is in the Subversion repositories. The refcursor's can be walked using PgDataReader.NextResult method. The support has some limitations: 1. It will work only for CommandType.StoredProcedure commands. 2. The result of the stored procedure should be a single value of type refcursor. Modified Paths: -------------- trunk/PostgreSqlClient/changelog.txt Modified: trunk/PostgreSqlClient/changelog.txt =================================================================== --- trunk/PostgreSqlClient/changelog.txt 2006-05-18 19:51:21 UTC (rev 145) +++ trunk/PostgreSqlClient/changelog.txt 2006-05-18 19:52:22 UTC (rev 146) @@ -4,6 +4,9 @@ 2006-05-18 Carlos Guzman Alvarez (car...@gm...) + * Added initial refcursor support for StoredProcedure calls + to the PgDataReader class ( multiple refcursor's supported ). + * Initial implementation for PostgreSql Domains, not all domains are supported only those who have a base data type that is supported by the provider This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-18 19:51:34
|
Revision: 145 Author: carlosga_fb Date: 2006-05-18 12:51:21 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=145&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Added initial refcursor support for StoredProcedure calls to the PgDataReader class ( multiple refcursor's supported ). Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDbType.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs 2006-05-18 19:49:14 UTC (rev 144) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs 2006-05-18 19:51:21 UTC (rev 145) @@ -371,7 +371,7 @@ public new PgDataReader ExecuteReader() { - return ExecuteReader(CommandBehavior.Default); + return this.ExecuteReader(CommandBehavior.Default); } public new PgDataReader ExecuteReader(CommandBehavior behavior) @@ -391,7 +391,7 @@ this.InternalExecute(); } - this.activeDataReader = new PgDataReader(this, this.connection); + this.activeDataReader = new PgDataReader(this.connection, this); return this.activeDataReader; } @@ -443,8 +443,9 @@ sql = this.BuildStoredProcedureSql(sql); } - string prepareName = "PS" + this.GetStmtName(); - string portalName = "PR" + this.GetStmtName(); + string statementName = this.GetStmtName(); + string prepareName = String.Format("PS{0}", statementName); + string portalName = String.Format("PR{0}", statementName); this.statement = conn.Database.CreateStatement(prepareName, portalName, this.ParseNamedParameters(sql)); Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs 2006-05-18 19:49:14 UTC (rev 144) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs 2006-05-18 19:51:21 UTC (rev 145) @@ -38,11 +38,13 @@ private int position; private int recordsAffected; private int fieldCount; + private object[] row; private DataTable schemaTable; private CommandBehavior behavior; private PgCommand command; private PgConnection connection; - private object[] row; + private PgStatement statement; + private Queue refCursors; #endregion @@ -62,20 +64,19 @@ #region \xB7 Constructors \xB7 - private PgDataReader() + internal PgDataReader(PgConnection connection, PgCommand command) { - this.open = true; - this.position = STARTPOS; - this.recordsAffected = -1; - this.fieldCount = -1; - } + this.open = true; + this.recordsAffected = -1; + this.position = STARTPOS; + this.fieldCount = -1; + this.refCursors = new Queue(); + this.connection = connection; + this.command = command; + this.behavior = this.command.CommandBehavior; + this.statement = this.command.Statement; - internal PgDataReader(PgCommand command, PgConnection connection) : this() - { - this.command = command; - this.behavior = this.command.CommandBehavior; - this.connection = connection; - this.fieldCount = this.command.Statement.RowDescriptor.Fields.Length; + this.Initialize(); } #endregion @@ -102,6 +103,16 @@ { // release any managed resources this.Close(); + + this.command = null; + this.statement = null; + this.connection = null; + this.refCursors = null; + this.row = null; + this.schemaTable = null; + this.fieldCount = -1; + this.recordsAffected = -1; + this.position = -1; } // release any unmanaged resources @@ -167,33 +178,60 @@ } } + this.refCursors.Clear(); + this.open = false; this.position = STARTPOS; } public override bool NextResult() { - return false; + bool hasMoreResults = false; + + if (this.refCursors.Count != 0 && this.connection.InternalConnection.HasActiveTransaction) + { + string sql = String.Format("fetch all in \"{0}\"", (string)this.refCursors.Dequeue()); + + // Reset position and field count + this.position = STARTPOS; + this.fieldCount = -1; + + // Close the active statement + this.statement.Close(); + + // Create a new statement to fetch the current refcursor + string statementName = Guid.NewGuid().ToString(); + string prepareName = String.Format("PS{0}", statementName); + string portalName = String.Format("PR{0}", statementName); + + this.statement = this.connection.InternalConnection.Database.CreateStatement(prepareName, portalName, sql); + this.statement.Parse(); + this.statement.Describe(); + this.statement.Bind(); + this.statement.Execute(); + + // Allow the DataReader to process more refcursors + hasMoreResults = true; + } + + return hasMoreResults; } public override bool Read() { bool read = false; - if ((this.behavior == CommandBehavior.SingleRow && - this.position != STARTPOS) || - !this.command.Statement.HasRows) + if ((this.behavior == CommandBehavior.SingleRow && this.position != STARTPOS) || + !this.command.Statement.HasRows) { } else { try { - this.fieldCount = this.command.Statement.RowDescriptor.Fields.Length; - this.position++; - row = this.command.Statement.FetchRow(); + row = this.statement.FetchRow(); read = (this.row == null) ? false : true; } @@ -212,11 +250,11 @@ public override DataTable GetSchemaTable() { - if (schemaTable == null) - { - schemaTable = this.GetSchemaTableStructure(); + if (this.schemaTable == null) + { + this.schemaTable = this.GetSchemaTableStructure(); - schemaTable.BeginLoadData(); + this.schemaTable.BeginLoadData(); PgCommand columnsCmd = new PgCommand(this.GetColumnsSql(), this.connection); columnsCmd.Parameters.Add("@OidNumber", PgDbType.Int4); @@ -225,16 +263,16 @@ PgCommand primaryKeyCmd = new PgCommand(this.GetPrimaryKeysSql(), this.connection); primaryKeyCmd.Parameters.Add("@OidTable", PgDbType.Int4); - for (int i = 0; i < command.Statement.RowDescriptor.Fields.Length; i++) + for (int i = 0; i < this.statement.RowDescriptor.Fields.Length; i++) { object[] columnInfo = null; Array pKeyInfo = null; // Execute commands - columnsCmd.Parameters[0].Value = command.Statement.RowDescriptor.Fields[i].OidNumber; - columnsCmd.Parameters[1].Value = command.Statement.RowDescriptor.Fields[i].OidTable; + columnsCmd.Parameters[0].Value = this.statement.RowDescriptor.Fields[i].OidNumber; + columnsCmd.Parameters[1].Value = this.statement.RowDescriptor.Fields[i].OidTable; - primaryKeyCmd.Parameters[0].Value = command.Statement.RowDescriptor.Fields[i].OidTable; + primaryKeyCmd.Parameters[0].Value = this.statement.RowDescriptor.Fields[i].OidTable; columnsCmd.InternalPrepare(); // First time it will prepare the command, next times it will close the open portal columnsCmd.InternalExecute(); @@ -256,7 +294,7 @@ } // Add row information - DataRow schemaRow = schemaTable.NewRow(); + DataRow schemaRow = this.schemaTable.NewRow(); schemaRow["ColumnName"] = this.GetName(i); schemaRow["ColumnOrdinal"] = (i + 1); @@ -301,16 +339,16 @@ schemaRow["BaseColumnName"] = System.DBNull.Value; } - schemaTable.Rows.Add(schemaRow); + this.schemaTable.Rows.Add(schemaRow); } - schemaTable.EndLoadData(); + this.schemaTable.EndLoadData(); columnsCmd.Dispose(); primaryKeyCmd.Dispose(); - } + } - return schemaTable; + return this.schemaTable; } private string GetColumnsSql() @@ -372,14 +410,22 @@ public override int FieldCount { - get { return this.command.Statement.RowDescriptor.Fields.Length; } + get + { + if (this.statement != null) + { + return this.statement.RowDescriptor.Fields.Length; + } + + return -1; + } } public override String GetName(int i) { this.CheckIndex(i); - return this.command.Statement.RowDescriptor.Fields[i].FieldName; + return this.statement.RowDescriptor.Fields[i].FieldName; } [EditorBrowsable(EditorBrowsableState.Never)] @@ -387,14 +433,14 @@ { this.CheckIndex(i); - return this.command.Statement.RowDescriptor.Fields[i].DataType.Name; + return this.statement.RowDescriptor.Fields[i].DataType.Name; } public override Type GetFieldType(int i) { this.CheckIndex(i); - return this.command.Statement.RowDescriptor.Fields[i].DataType.SystemType; + return this.statement.RowDescriptor.Fields[i].DataType.SystemType; } public override object GetValue(int i) @@ -411,7 +457,7 @@ for (int i = 0; i < this.FieldCount; i++) { - values[i] = GetValue(i); + values[i] = this.GetValue(i); } return values.Length; @@ -426,7 +472,7 @@ for (int i = 0; i < this.FieldCount; i++) { - if (this.CultureAwareCompare(command.Statement.RowDescriptor.Fields[i].FieldName, name)) + if (this.CultureAwareCompare(this.statement.RowDescriptor.Fields[i].FieldName, name)) { return i; } @@ -725,9 +771,40 @@ #region \xB7 Private Methods \xB7 + private void Initialize() + { + if (this.connection.InternalConnection.HasActiveTransaction) + { + // Ref cursors can be fetched only if there are an active transaction + if (this.command.CommandType == CommandType.StoredProcedure && + this.command.Statement.RowDescriptor.Fields.Length == 1 && + this.command.Statement.RowDescriptor.Fields[0].DataType.IsRefCursor) + { + // Clear refcursor's queue + this.refCursors.Clear(); + + // Add refcrusr's names to the queue + object[] row = new object[0]; + + while (row != null) + { + row = this.statement.FetchRow(); + + if (row != null) + { + this.refCursors.Enqueue(row[0]); + } + } + + // Grab information of the first refcursor + this.NextResult(); + } + } + } + private void CheckIndex(int i) { - if (i < 0 || i >= this.fieldCount) + if (i < 0 || i >= this.FieldCount) { throw new IndexOutOfRangeException("Could not find specified column in results."); } @@ -770,7 +847,7 @@ throw new IndexOutOfRangeException("Could not find specified column in results."); } - return this.command.Statement.RowDescriptor.Fields[i].DataType.IsNumeric(); + return this.command.Statement.RowDescriptor.Fields[i].DataType.IsNumeric; } private bool IsLong(int i) @@ -780,7 +857,7 @@ throw new IndexOutOfRangeException("Could not find specified column in results."); } - return this.command.Statement.RowDescriptor.Fields[i].DataType.IsLong(); + return this.command.Statement.RowDescriptor.Fields[i].DataType.IsLong; } private bool IsAliased(int i) Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDbType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDbType.cs 2006-05-18 19:49:14 UTC (rev 144) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgDbType.cs 2006-05-18 19:51:21 UTC (rev 145) @@ -44,6 +44,7 @@ Path , Point , Polygon , + Refcursor , Text , Time , TimeWithTZ , This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-18 19:49:23
|
Revision: 144 Author: carlosga_fb Date: 2006-05-18 12:49:14 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=144&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Added initial refcursor support for StoredProcedure calls to the PgDataReader class ( multiple refcursor's supported ). Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDataType.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -46,6 +46,7 @@ Path , Point , Polygon , + Refcursor , Text , Time , TimeWithTZ , Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -101,7 +101,7 @@ DataTypes.Add(1560 , "bit" , PgDataType.Byte , 0, PgTypeFormat.Text, 1); DataTypes.Add(1562 , "varbit" , PgDataType.Byte , 0, PgTypeFormat.Binary, 0); DataTypes.Add(1700 , "numeric" , PgDataType.Decimal , 0, PgTypeFormat.Text, 8); - DataTypes.Add(1790 , "refcursor" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); + DataTypes.Add(1790 , "refcursor" , PgDataType.Refcursor , 0, PgTypeFormat.Text, 0); DataTypes.Add(2277 , "anyarray" , PgDataType.Array , 0, PgTypeFormat.Binary, 8); } Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -397,6 +397,7 @@ return this.ReadString(length).TrimEnd(); case PgDataType.VarChar: + case PgDataType.Refcursor: return this.ReadString(length); case PgDataType.Boolean: @@ -488,7 +489,8 @@ case PgDataType.Char: return stringValue.TrimEnd(); - case PgDataType.VarChar: + case PgDataType.VarChar: + case PgDataType.Refcursor: return stringValue; case PgDataType.Boolean: Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -318,7 +318,7 @@ packet.Write((short)this.rowDescriptor.Fields.Length); for (int i = 0; i < this.rowDescriptor.Fields.Length; i++) { - packet.Write((short)this.rowDescriptor.Fields[i].DataType.FormatCode); + packet.Write((short)this.rowDescriptor.Fields[i].FormatCode); } // Send packet to the server Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-18 13:32:38 UTC (rev 143) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgType.cs 2006-05-18 19:49:14 UTC (rev 144) @@ -81,6 +81,48 @@ get { return this.size; } } + public bool IsNumeric + { + get + { + bool returnValue = false; + + if (this.dataType == PgDataType.Currency || + this.dataType == PgDataType.Int2 || + this.dataType == PgDataType.Int4 || + this.dataType == PgDataType.Int8 || + this.dataType == PgDataType.Float || + this.dataType == PgDataType.Double || + this.dataType == PgDataType.Decimal || + this.dataType == PgDataType.Byte) + { + returnValue = true; + } + + return returnValue; + } + } + + public bool IsLong + { + get + { + bool returnValue = false; + + if (this.dataType == PgDataType.Binary) + { + returnValue = true; + } + + return returnValue; + } + } + + public bool IsRefCursor + { + get { return (this.DataType == PgDataType.Refcursor); } + } + #endregion #region \xB7 Constructors \xB7 @@ -98,41 +140,6 @@ #endregion - #region \xB7 Methods \xB7 - - public bool IsNumeric() - { - bool returnValue = false; - - if (this.dataType == PgDataType.Currency || - this.dataType == PgDataType.Int2 || - this.dataType == PgDataType.Int4 || - this.dataType == PgDataType.Int8 || - this.dataType == PgDataType.Float || - this.dataType == PgDataType.Double || - this.dataType == PgDataType.Decimal || - this.dataType == PgDataType.Byte) - { - returnValue = true; - } - - return returnValue; - } - - public bool IsLong() - { - bool returnValue = false; - - if (this.dataType == PgDataType.Binary) - { - returnValue = true; - } - - return returnValue; - } - - #endregion - #region \xB7 Private Methods \xB7 private Type InferSystemType() @@ -203,6 +210,9 @@ case PgDataType.Int8: return Type.GetType("System.Int64"); + case PgDataType.Refcursor: + return typeof(DataTable); + default: return Type.GetType("System.Object"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-18 13:33:04
|
Revision: 143 Author: carlosga_fb Date: 2006-05-18 06:32:38 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=143&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Initial implementation for PostgreSql Domains, not all domains are supported only those who have a base data type that is supported by the provider Modified Paths: -------------- trunk/PostgreSqlClient/changelog.txt Modified: trunk/PostgreSqlClient/changelog.txt =================================================================== --- trunk/PostgreSqlClient/changelog.txt 2006-05-18 13:32:04 UTC (rev 142) +++ trunk/PostgreSqlClient/changelog.txt 2006-05-18 13:32:38 UTC (rev 143) @@ -4,6 +4,10 @@ 2006-05-18 Carlos Guzman Alvarez (car...@gm...) + * Initial implementation for PostgreSql Domains, + not all domains are supported only those who have + a base data type that is supported by the provider + * Fixed bug on parameters collection references on file PgCommand.cs ( Thanks to Alexander Tyaglov for his feedback ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-18 13:32:22
|
Revision: 142 Author: carlosga_fb Date: 2006-05-18 06:32:04 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=142&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Initial implementation for PostgreSql Domains, not all domains are supported only those who have a base data type that is supported by the provider Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgParameter.cs trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgParameter.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgParameter.cs 2006-05-18 11:37:30 UTC (rev 141) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgParameter.cs 2006-05-18 13:32:04 UTC (rev 142) @@ -24,6 +24,7 @@ #region \xB7 Fields \xB7 private PgType dataType; + private int dataTypeOid; private object data; #endregion @@ -42,6 +43,11 @@ set { this.data = value; } } + public int DataTypeOid + { + get { return this.dataTypeOid; } + } + #endregion #region \xB7 Constructors \xB7 @@ -50,9 +56,14 @@ { } - public PgParameter(int dataType) + public PgParameter(int dataTypeOid) { - this.dataType = PgDatabase.DataTypes[dataType]; + this.dataTypeOid = dataTypeOid; + + if (PgDatabase.DataTypes.Contains(dataTypeOid)) + { + this.dataType = PgDatabase.DataTypes[dataTypeOid]; + } } public PgParameter(int dataType, object data) : this(dataType) Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-18 11:37:30 UTC (rev 141) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgStatement.cs 2006-05-18 13:32:04 UTC (rev 142) @@ -210,7 +210,7 @@ { this.Describe('P'); } - + private void Describe(char stmtType) { lock (this.db) @@ -239,6 +239,40 @@ } while (!response.IsRowDescription && !response.IsNoData); + // Review if there are some parameter witha domain as a Data Type + foreach (PgParameter parameter in this.parameters) + { + if (parameter.DataType == null) + { + // It's a non supported data type or a domain data type + PgStatement stmt = new PgStatement(this.db, String.Format("select typbasetype from pg_type where oid = {0} and typtype = 'd'", parameter.DataTypeOid)); + + try + { + stmt.Query(); + + if (!stmt.HasRows) + { + throw new PgClientException("Unsupported data type"); + } + + int baseTypeOid = Convert.ToInt32(stmt.FetchRow()[0]); + + if (baseTypeOid == 0 || !PgDatabase.DataTypes.Contains(baseTypeOid)) + { + throw new PgClientException("Unsupported data type"); + } + + // Try to add the data type to the list of supported data types + parameter.DataType = PgDatabase.DataTypes[baseTypeOid]; + } + catch + { + throw new PgClientException("Unsupported data type"); + } + } + } + // Update status this.status = PgStatementStatus.Described; } @@ -417,63 +451,64 @@ lock (this.db) { - try - { - PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); + try + { + PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); - packet.WriteNullString(this.stmtText); + packet.WriteNullString(this.stmtText); - // Send packet to the server - this.db.SendPacket(packet, PgFrontEndCodes.QUERY); + // Send packet to the server + this.db.SendPacket(packet, PgFrontEndCodes.QUERY); - // Update Status - this.status = PgStatementStatus.OnQuery; + // Update Status + this.status = PgStatementStatus.OnQuery; - // Set fetch size - this.fetchSize = 1; + // Set fetch size + this.fetchSize = 1; - // Receive response - PgResponsePacket response = null; - - do - { - response = this.db.ReceiveResponsePacket(); - this.ProcessSqlPacket(response); + // Receive response + PgResponsePacket response = null; - if (this.hasRows && - response.Message == PgBackendCodes.DATAROW) - { - innerRows.Add(this.rows[0]); - this.rowIndex = 0; - } - } - while (!response.IsReadyForQuery); - - if (this.hasRows) - { - // Obtain all the rows - this.rows = (object[])innerRows.ToArray(typeof(object)); + do + { + response = this.db.ReceiveResponsePacket(); + this.ProcessSqlPacket(response); - // reset rowIndex - this.rowIndex = 0; + if (this.hasRows && response.Message == PgBackendCodes.DATAROW) + { + innerRows.Add(this.rows[0]); + this.rowIndex = 0; + } + } + while (!response.IsReadyForQuery); - // Set allRowsFetched flag - this.allRowsFetched = true; - } + if (this.hasRows) + { + // Obtain all the rows + this.rows = (object[])innerRows.ToArray(typeof(object)); - // reset fetch size - this.fetchSize = 200; + // reset rowIndex + this.rowIndex = 0; - // Update status - this.status = PgStatementStatus.Executed; - } - catch - { - // Update status - this.status = PgStatementStatus.Error; - // Throw exception - throw; - } + // Set allRowsFetched flag + this.allRowsFetched = true; + } + + // Update status + this.status = PgStatementStatus.Executed; + } + catch + { + // Update status + this.status = PgStatementStatus.Error; + // Throw exception + throw; + } + finally + { + // reset fetch size + this.fetchSize = 200; + } } } @@ -529,31 +564,31 @@ { string name = ((stmtType == 'S') ? this.ParseName : this.PortalName); - PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); + PgOutputPacket packet = new PgOutputPacket(this.db.Encoding); - packet.Write((byte)stmtType); - packet.WriteNullString(name); + packet.Write((byte)stmtType); + packet.WriteNullString(String.IsNullOrEmpty(name) ? "" : name); - // Send packet to the server - this.db.SendPacket(packet, PgFrontEndCodes.CLOSE); + // Send packet to the server + this.db.SendPacket(packet, PgFrontEndCodes.CLOSE); - // Sync server and client - this.db.Flush(); + // Sync server and client + this.db.Flush(); - // Read until CLOSE COMPLETE message is received - PgResponsePacket response = null; - - do - { - response = this.db.ReceiveResponsePacket(); - this.ProcessSqlPacket(response); - } - while (!response.IsCloseComplete); + // Read until CLOSE COMPLETE message is received + PgResponsePacket response = null; - // Clear rows - this.rows = null; - this.rowIndex = 0; + do + { + response = this.db.ReceiveResponsePacket(); + this.ProcessSqlPacket(response); + } + while (!response.IsCloseComplete); + // Clear rows + this.rows = null; + this.rowIndex = 0; + // Update Status this.status = PgStatementStatus.Initial; } @@ -703,7 +738,7 @@ this.rowDescriptor.Fields[i].DataType = PgDatabase.DataTypes[packet.ReadInt32()]; this.rowDescriptor.Fields[i].DataTypeSize = packet.ReadInt16(); this.rowDescriptor.Fields[i].TypeModifier = packet.ReadInt32(); - this.rowDescriptor.Fields[i].FormatCode = (PgTypeFormat)packet.ReadInt16(); + this.rowDescriptor.Fields[i].FormatCode = (PgTypeFormat)packet.ReadInt16(); } } @@ -713,7 +748,7 @@ for (int i = 0; i < parameters.Length; i++) { - this.parameters[i] = new PgParameter(packet.ReadInt32()); + this.parameters[i] = new PgParameter(packet.ReadInt32()); } } @@ -739,7 +774,7 @@ break; default: - if (this.rowDescriptor.Fields[i].DataType.FormatCode == PgTypeFormat.Text) + if (this.rowDescriptor.Fields[i].FormatCode == PgTypeFormat.Text) { values[i] = packet.ReadValueFromString(this.rowDescriptor.Fields[i].DataType, length); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-18 11:37:36
|
Revision: 141 Author: carlosga_fb Date: 2006-05-18 04:37:30 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=141&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Fixed bug on parameters collection references on file PgCommand.cs ( Thanks to Alexander Tyaglov for his feedback ) * Use Guids for portal names. Modified Paths: -------------- trunk/PostgreSqlClient/changelog.txt Modified: trunk/PostgreSqlClient/changelog.txt =================================================================== --- trunk/PostgreSqlClient/changelog.txt 2006-05-18 11:36:55 UTC (rev 140) +++ trunk/PostgreSqlClient/changelog.txt 2006-05-18 11:37:30 UTC (rev 141) @@ -2,6 +2,13 @@ ---------------- - ----------------------------------------- +2006-05-18 Carlos Guzman Alvarez (car...@gm...) + + * Fixed bug on parameters collection references on file PgCommand.cs + ( Thanks to Alexander Tyaglov for his feedback ) + + * Use Guids for portal names. + 2006-05-17 Carlos Guzman Alvarez (car...@gm...) * Fixed bad references in PgConnectionPoolManager class. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-18 11:37:04
|
Revision: 140 Author: carlosga_fb Date: 2006-05-18 04:36:55 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=140&view=rev Log Message: ----------- 2006-05-18 Carlos Guzman Alvarez (car...@gm...) * Fixed bug on parameters collection references on file PgCommand.cs ( Thanks to Alexander Tyaglov for his feedback ) Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs 2006-05-17 17:34:26 UTC (rev 139) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgCommand.cs 2006-05-18 11:36:55 UTC (rev 140) @@ -152,6 +152,7 @@ { this.parameters = new PgParameterCollection(); } + return this.parameters; } } @@ -507,9 +508,9 @@ internal void InternalSetOutputParameters() { if (this.CommandType == CommandType.StoredProcedure && - this.parameters.Count > 0) + this.Parameters.Count > 0) { - IEnumerator paramEnumerator = this.parameters.GetEnumerator(); + IEnumerator paramEnumerator = this.Parameters.GetEnumerator(); int i = 0; if (this.statement.Rows != null && this.statement.Rows.Length > 0) @@ -582,15 +583,15 @@ paramsText.Append(commandText); paramsText.Append("("); - for (int i = 0; i < this.parameters.Count; i++) + for (int i = 0; i < this.Parameters.Count; i++) { - if (this.parameters[i].Direction == ParameterDirection.Input || - this.parameters[i].Direction == ParameterDirection.InputOutput) + if (this.Parameters[i].Direction == ParameterDirection.Input || + this.Parameters[i].Direction == ParameterDirection.InputOutput) { // Append parameter name to parameter list - paramsText.Append(this.parameters[i].ParameterName); + paramsText.Append(this.Parameters[i].ParameterName); - if (i != this.parameters.Count - 1) + if (i != this.Parameters.Count - 1) { paramsText = paramsText.Append(","); } @@ -608,7 +609,7 @@ private string GetStmtName() { - return GetHashCode().ToString() + this.connection.GetHashCode().ToString() + DateTime.Now.Ticks; + return Guid.NewGuid().ToString(); } private string ParseNamedParameters(string sql) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-17 17:34:36
|
Revision: 139 Author: carlosga_fb Date: 2006-05-17 10:34:26 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=139&view=rev Log Message: ----------- 2006-05-17 Carlos Guzman Alvarez (car...@gm...) * Fixed bad references in PgConnectionPoolManager class. Modified Paths: -------------- trunk/PostgreSqlClient/changelog.txt Modified: trunk/PostgreSqlClient/changelog.txt =================================================================== --- trunk/PostgreSqlClient/changelog.txt 2006-05-17 17:33:44 UTC (rev 138) +++ trunk/PostgreSqlClient/changelog.txt 2006-05-17 17:34:26 UTC (rev 139) @@ -2,6 +2,10 @@ ---------------- - ----------------------------------------- +2006-05-17 Carlos Guzman Alvarez (car...@gm...) + + * Fixed bad references in PgConnectionPoolManager class. + 2006-05-15 Carlos Guzman Alvarez (car...@gm...) * Fixed bpchar data type mapping in protocol implementation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-17 17:34:04
|
Revision: 138 Author: carlosga_fb Date: 2006-05-17 10:33:44 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=138&view=rev Log Message: ----------- 2006-05-17 Carlos Guzman Alvarez (car...@gm...) * Fixed bad references in PgConnectionPoolManager class. Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgPoolManager.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgPoolManager.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgPoolManager.cs 2006-05-15 13:26:30 UTC (rev 137) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/PostgreSqlClient/PgPoolManager.cs 2006-05-17 17:33:44 UTC (rev 138) @@ -137,7 +137,7 @@ if (this.Pools.ContainsKey(hashCode)) { - pool = (PgConnectionPool)pools[hashCode]; + pool = (PgConnectionPool)this.Pools[hashCode]; } } @@ -154,7 +154,7 @@ if (pool == null) { - lock (this.pools.SyncRoot) + lock (this.Pools.SyncRoot) { int hashcode = connectionString.GetHashCode(); @@ -166,7 +166,7 @@ // Create the new connection pool pool = new PgConnectionPool(connectionString); - this.pools.Add(hashcode, pool); + this.Pools.Add(hashcode, pool); pool.EmptyPool += handler; } @@ -180,11 +180,11 @@ { lock (this.SyncObject) { - lock (this.pools.SyncRoot) + lock (this.Pools.SyncRoot) { - PgConnectionPool[] tempPools = new PgConnectionPool[this.pools.Count]; + PgConnectionPool[] tempPools = new PgConnectionPool[this.Pools.Count]; - this.pools.Values.CopyTo(tempPools, 0); + this.Pools.Values.CopyTo(tempPools, 0); foreach (PgConnectionPool pool in tempPools) { @@ -193,8 +193,8 @@ } // Clear Hashtables - this.pools.Clear(); - this.handlers.Clear(); + this.Pools.Clear(); + this.Handlers.Clear(); } } } @@ -203,13 +203,13 @@ { lock (this.SyncObject) { - lock (this.pools.SyncRoot) + lock (this.Pools.SyncRoot) { int hashCode = connectionString.GetHashCode(); - if (this.pools.ContainsKey(hashCode)) + if (this.Pools.ContainsKey(hashCode)) { - PgConnectionPool pool = (PgConnectionPool)this.pools[hashCode]; + PgConnectionPool pool = (PgConnectionPool)this.Pools[hashCode]; // Clear pool pool.Clear(); @@ -235,7 +235,7 @@ { int hashCode = (int)sender; - if (this.pools.ContainsKey(hashCode)) + if (this.Pools.ContainsKey(hashCode)) { PgConnectionPool pool = (PgConnectionPool)this.Pools[hashCode]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-15 13:26:36
|
Revision: 137 Author: carlosga_fb Date: 2006-05-15 06:26:30 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=137&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.suo Modified: trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-15 13:26:12
|
Revision: 136 Author: carlosga_fb Date: 2006-05-15 06:26:06 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=136&view=rev Log Message: ----------- Updated changelog.txt Modified Paths: -------------- trunk/PostgreSqlClient/changelog.txt Modified: trunk/PostgreSqlClient/changelog.txt =================================================================== --- trunk/PostgreSqlClient/changelog.txt 2006-05-15 13:24:00 UTC (rev 135) +++ trunk/PostgreSqlClient/changelog.txt 2006-05-15 13:26:06 UTC (rev 136) @@ -1,6 +1,14 @@ PostgreSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ ---------------- - ----------------------------------------- + +2006-05-15 Carlos Guzman Alvarez (car...@gm...) + + * Fixed bpchar data type mapping in protocol implementation + + * Trim traling spaces when reading character values ( char or bpchar + datatype fields ) + 2006-04-14 Carlos Guzman Alvarez (car...@te...) * Ported the connection pooling implementation from the FirebirdClient provider. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-15 13:24:06
|
Revision: 135 Author: carlosga_fb Date: 2006-05-15 06:24:00 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=135&view=rev Log Message: ----------- ?\194?\183 Trim traling spaces on Char fields ( they are not significant in PostgreSQL ) Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-15 13:23:15 UTC (rev 134) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-15 13:24:00 UTC (rev 135) @@ -394,6 +394,8 @@ return this.ReadBytes(length); case PgDataType.Char: + return this.ReadString(length).TrimEnd(); + case PgDataType.VarChar: return this.ReadString(length); @@ -484,6 +486,8 @@ return null; case PgDataType.Char: + return stringValue.TrimEnd(); + case PgDataType.VarChar: return stringValue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-15 13:23:21
|
Revision: 134 Author: carlosga_fb Date: 2006-05-15 06:23:15 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=134&view=rev Log Message: ----------- ?\194?\183 Fixed bpchar mapping Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-15 12:47:08 UTC (rev 133) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-05-15 13:23:15 UTC (rev 134) @@ -90,7 +90,7 @@ DataTypes.Add(1028 , "_oid" , PgDataType.Array , 26, PgTypeFormat.Binary, 4); DataTypes.Add(1033 , "aclitem" , PgDataType.VarChar , 0, PgTypeFormat.Text, 12); DataTypes.Add(1034 , "_aclitem" , PgDataType.Array , 1033, PgTypeFormat.Text, 0); - DataTypes.Add(1042 , "bpchar" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); + DataTypes.Add(1042 , "bpchar" , PgDataType.Char , 0, PgTypeFormat.Text, 0); DataTypes.Add(1043 , "varchar" , PgDataType.VarChar , 0, PgTypeFormat.Text, 0); DataTypes.Add(1082 , "date" , PgDataType.Date , 0, PgTypeFormat.Binary, 4); DataTypes.Add(1083 , "time" , PgDataType.Time , 0, PgTypeFormat.Text, 8); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-15 12:47:13
|
Revision: 133 Author: carlosga_fb Date: 2006-05-15 05:47:08 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=133&view=rev Log Message: ----------- undo latest commit Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-14 14:43:04 UTC (rev 132) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-15 12:47:08 UTC (rev 133) @@ -394,11 +394,9 @@ return this.ReadBytes(length); case PgDataType.Char: + case PgDataType.VarChar: return this.ReadString(length); - case PgDataType.VarChar: - return this.ReadString(length).TrimEnd(); - case PgDataType.Boolean: return this.ReadBoolean(); @@ -486,11 +484,9 @@ return null; case PgDataType.Char: + case PgDataType.VarChar: return stringValue; - case PgDataType.VarChar: - return stringValue.TrimEnd(); - case PgDataType.Boolean: switch (stringValue.ToLower()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-14 14:43:11
|
Revision: 132 Author: carlosga_fb Date: 2006-05-14 07:43:04 -0700 (Sun, 14 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=132&view=rev Log Message: ----------- Trim the end of the varchar field values Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-05 14:56:28 UTC (rev 131) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgResponsePacket.cs 2006-05-14 14:43:04 UTC (rev 132) @@ -394,8 +394,10 @@ return this.ReadBytes(length); case PgDataType.Char: + return this.ReadString(length); + case PgDataType.VarChar: - return this.ReadString(length); + return this.ReadString(length).TrimEnd(); case PgDataType.Boolean: return this.ReadBoolean(); @@ -484,8 +486,10 @@ return null; case PgDataType.Char: + return stringValue; + case PgDataType.VarChar: - return stringValue; + return stringValue.TrimEnd(); case PgDataType.Boolean: switch (stringValue.ToLower()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-05 14:56:44
|
Revision: 131 Author: carlosga_fb Date: 2006-05-05 07:56:28 -0700 (Fri, 05 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=131&view=rev Log Message: ----------- test Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs 2006-05-05 14:56:01 UTC (rev 130) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs 2006-05-05 14:56:28 UTC (rev 131) @@ -149,7 +149,6 @@ #endregion - #region \xB7 Boolean Types \xB7 public void Write(bool value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-05-05 14:56:11
|
Revision: 130 Author: carlosga_fb Date: 2006-05-05 07:56:01 -0700 (Fri, 05 May 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=130&view=rev Log Message: ----------- Test Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs 2006-04-17 13:00:36 UTC (rev 129) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgOutputPacket.cs 2006-05-05 14:56:01 UTC (rev 130) @@ -149,6 +149,7 @@ #endregion + #region \xB7 Boolean Types \xB7 public void Write(bool value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-04-17 13:01:08
|
Revision: 129 Author: carlosga_fb Date: 2006-04-17 06:00:36 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=129&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs Modified: trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-04-17 12:59:43 UTC (rev 128) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Protocol/PgDatabase.cs 2006-04-17 13:00:36 UTC (rev 129) @@ -123,10 +123,10 @@ Charactersets.Add("ISO_8859_7" , 1253); // ISO 8859-7/ECMA 118 (Latin/Greek) Charactersets.Add("LATIN9" , "iso-8859-15"); // ISO 8859-15 (Latin alphabet no.9) Charactersets.Add("KOI8" , "koi8-r"); // KOI8-R(U) - Charactersets.Add("WIN" , "windows-1251"); // Windows CP1251 + Charactersets.Add("WIN" , "windows-1251"); // Windows CP1251 + Charactersets.Add("WIN1251" , "windows-1251");// Windows CP1251 Charactersets.Add("WIN1256" , "windows-1256"); // Windows CP1256 (Arabic) - Charactersets.Add("WIN1256" , "windows-1256"); // Windows CP1256 (Arabic) - Charactersets.Add("WIN1256" , "windows-1258"); // TCVN-5712/Windows CP1258 (Vietnamese) + Charactersets.Add("WIN1258" , "windows-1258"); // TCVN-5712/Windows CP1258 (Vietnamese) Charactersets.Add("WIN1256" , "windows-874"); // Windows CP874 (Thai) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2006-04-17 12:59:53
|
Revision: 128 Author: carlosga_fb Date: 2006-04-17 05:59:43 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=128&view=rev Log Message: ----------- Modified Paths: -------------- trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.sln trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.suo Modified: trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.sln =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.sln 2006-04-17 12:40:51 UTC (rev 127) +++ trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.sln 2006-04-17 12:59:43 UTC (rev 128) @@ -11,8 +11,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostgreSql.VisualStudio.DataTools", "PostgreSql\VisualStudio\DataTools\PostgreSql.VisualStudio.DataTools.csproj", "{371E5E40-132D-4CBA-A93A-814B835A44D5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication1", "C:\Documents and Settings\Carlos\Mis documentos\Visual Studio 2005\Projects\ConsoleApplication1\ConsoleApplication1.csproj", "{551AE979-8D9C-43AF-8021-4E5FB6865490}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,10 +37,6 @@ {371E5E40-132D-4CBA-A93A-814B835A44D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {371E5E40-132D-4CBA-A93A-814B835A44D5}.Release|Any CPU.ActiveCfg = Release|Any CPU {371E5E40-132D-4CBA-A93A-814B835A44D5}.Release|Any CPU.Build.0 = Release|Any CPU - {551AE979-8D9C-43AF-8021-4E5FB6865490}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {551AE979-8D9C-43AF-8021-4E5FB6865490}.Debug|Any CPU.Build.0 = Debug|Any CPU - {551AE979-8D9C-43AF-8021-4E5FB6865490}.Release|Any CPU.ActiveCfg = Release|Any CPU - {551AE979-8D9C-43AF-8021-4E5FB6865490}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/PostgreSqlClient/source/PostgreSql.Data.PostgreSqlClient.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |