PostgreSQL Database.Exists()

PostgreSQL Database.Exists()

Postby nastradamus » Wed 28 May 2014 14:26

I'm trying to find out, if a database exist in my postgres server or not throught the EF 6, by using
Code: Select all
Context.Database.Exists()
. Unfortunatly, I always receive the following exception:
Code: Select all
The provider did not return a ProviderManifestToken string


A solution of a similar problem is available, but only for MYSQL (See [1]). I tried this approach:
Code: Select all
var config = Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfig.Instance;
                    config.DatabaseScript.Schema.DeleteDatabaseBehaviour = Devart.Data.PostgreSql.Entity.Configuration.DeleteDatabaseBehaviour.Database;

but it could not solve my problem.

Could you please help me to fix this problem.

Thank you in advance

[1] http://forums.devart.com/ru/viewtopic.php?f=29&t=13684
Last edited by nastradamus on Mon 02 Jun 2014 09:48, edited 1 time in total.
nastradamus
 
Posts: 5
Joined: Wed 14 May 2014 14:11

Re: POstgreSQL Database.Exists()

Postby Shalex » Thu 29 May 2014 04:23

Please specify the full stack trace of the error with all inner exceptions.
Shalex
Devart Team
 
Posts: 7793
Joined: Thu 14 Aug 2008 12:44

Re: POstgreSQL Database.Exists()

Postby nastradamus » Mon 02 Jun 2014 07:53

Thank you Shalex for your quick answer. here is my stacktrace:

Code: Select all
bei System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   bei System.Data.Entity.Utilities.DbProviderManifestExtensions.GetStoreTypeFromName(DbProviderManifest providerManifest, String name)
   bei System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(EdmProperty column, EntityType table, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration)
   bei System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.<>c__DisplayClass1.<Configure>b__0(Tuple`2 pm)
   bei System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable`1 ts, Action`1 action)
   bei System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(IEnumerable`1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration)
   bei System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.BinaryPropertyConfiguration.Configure(IEnumerable`1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration)
   bei System.Data.Entity.ModelConfiguration.Configuration.Types.StructuralTypeConfiguration.ConfigurePropertyMappings(IList`1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride)
   bei System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigurePropertyMappings(DbDatabaseMapping databaseMapping, EntityType entityType, DbProviderManifest providerManifest, Boolean allowOverride)
   bei System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(EntityType entityType, DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
   bei System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.ConfigureEntityTypes(DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
   bei System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure(DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest)
   bei System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
   bei System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
   bei System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
   bei System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
   bei System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   bei System.Data.Entity.Internal.InternalContext.CreateObjectContextForDdlOps()
   bei System.Data.Entity.Database.Exists()
   bei Program.CheckDatabaseExists(FreiZeitDatabaseContext Context) in path_to_file\program.cs:line 172.
nastradamus
 
Posts: 5
Joined: Wed 14 May 2014 14:11

Re: PostgreSQL Database.Exists()

Postby MariiaI » Mon 02 Jun 2014 10:31

We have contacted you by e-mail.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to dotConnect for PostgreSQL