Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from oskarb/schema-invariant-culture

NpgsqlSchema: Use InvariantCulture on all return DataTables with schema ...
  • Loading branch information...
commit 8aa88956e0655e2270bf1da1b54f05c749c9c9cd 2 parents 74e7be2 + c029bd7
@franciscojunior franciscojunior authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/Npgsql/NpgsqlSchema.cs
View
11 src/Npgsql/NpgsqlSchema.cs
@@ -27,6 +27,7 @@
using System;
using System.Data;
+using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text;
@@ -56,6 +57,7 @@ internal NpgsqlSchema(NpgsqlConnection connection)
internal static DataTable GetMetaDataCollections()
{
DataSet ds = new DataSet();
+ ds.Locale = CultureInfo.InvariantCulture;
using (Stream xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Npgsql.NpgsqlMetaData.xml"))
{
ds.ReadXml(xmlStream);
@@ -70,6 +72,7 @@ internal static DataTable GetMetaDataCollections()
internal static DataTable GetRestrictions()
{
DataSet ds = new DataSet();
+ ds.Locale = CultureInfo.InvariantCulture;
using (Stream xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Npgsql.NpgsqlMetaData.xml"))
{
ds.ReadXml(xmlStream);
@@ -129,6 +132,7 @@ private string RemoveSpecialChars(string paramName)
internal DataTable GetDatabases(string[] restrictions)
{
DataTable databases = new DataTable("Databases");
+ databases.Locale = CultureInfo.InvariantCulture;
databases.Columns.AddRange(
new DataColumn[] {new DataColumn("database_name"), new DataColumn("owner"), new DataColumn("encoding")});
@@ -157,6 +161,7 @@ internal DataTable GetDatabases(string[] restrictions)
internal DataTable GetTables(string[] restrictions)
{
DataTable tables = new DataTable("Tables");
+ tables.Locale = CultureInfo.InvariantCulture;
tables.Columns.AddRange(
new DataColumn[]
@@ -190,6 +195,7 @@ internal DataTable GetTables(string[] restrictions)
internal DataTable GetColumns(string[] restrictions)
{
DataTable columns = new DataTable("Columns");
+ columns.Locale = CultureInfo.InvariantCulture;
columns.Columns.AddRange(
new DataColumn[]
@@ -230,6 +236,7 @@ internal DataTable GetColumns(string[] restrictions)
internal DataTable GetViews(string[] restrictions)
{
DataTable views = new DataTable("Views");
+ views.Locale = CultureInfo.InvariantCulture;
views.Columns.AddRange(
new DataColumn[]
@@ -262,6 +269,7 @@ internal DataTable GetViews(string[] restrictions)
internal DataTable GetUsers(string[] restrictions)
{
DataTable users = new DataTable("Users");
+ users.Locale = CultureInfo.InvariantCulture;
users.Columns.AddRange(new DataColumn[] {new DataColumn("user_name"), new DataColumn("user_sysid", typeof (int))});
@@ -283,6 +291,7 @@ internal DataTable GetUsers(string[] restrictions)
internal DataTable GetIndexes(string[] restrictions)
{
DataTable indexes = new DataTable("Indexes");
+ indexes.Locale = CultureInfo.InvariantCulture;
indexes.Columns.AddRange(
new DataColumn[]
@@ -328,6 +337,7 @@ and pg_catalog.pg_table_is_visible(i.oid)
internal DataTable GetIndexColumns(string[] restrictions)
{
DataTable indexColumns = new DataTable("IndexColumns");
+ indexColumns.Locale = CultureInfo.InvariantCulture;
indexColumns.Columns.AddRange(
new DataColumn[]
@@ -418,6 +428,7 @@ internal static DataTable GetDataSourceInformation()
public static DataTable GetReservedWords()
{
DataTable table = new DataTable("ReservedWords");
+ table.Locale = CultureInfo.InvariantCulture;
table.Columns.Add("ReservedWord", typeof (string));
// List of keywords taken from PostgreSQL 9.0 reserved words documentation.
string[] keywords = new[]
Please sign in to comment.
Something went wrong with that request. Please try again.