Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Redshift connection fails with: database "postgres" does not exist #511

Copy link
Copy link
@andrewwwooster

Description

@andrewwwooster
Issue body actions

I am trying to use Npgsql.EntityFramework with the Amazon Redshift database.
Following comments in issue #163 I downloaded a match to lc_monetary fix from here:
https://build.npgsql.org/viewLog.html?buildId=14051&tab=artifacts&buildTypeId=npgsql_All22
I no longer get the lc_monetary error, but I do get the following exception:
Npgsql.NpgsqlException: FATAL: 3D000: database "postgres" does not exist

Redshift does not have a database named "postgres", why is Npgsql.EntityFramework looking for this database?

System.Data.Entity.Core.ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> Npgsql.NpgsqlException: FATAL: 3D000: database "postgres" does not exist
Result StackTrace:
at Npgsql.NpgsqlState.d__0.MoveNext() in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlState.BackendResponse.cs:line 143
at Npgsql.NpgsqlState.ProcessAndDiscardBackendResponses(NpgsqlConnector context) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlState.cs:line 283
at Npgsql.NpgsqlConnectedState.Startup(NpgsqlConnector context, NpgsqlConnectionStringBuilder settings) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlConnectedState.cs:line 47
at Npgsql.NpgsqlConnector.Open() in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlConnector.cs:line 801
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlConnectorPool.cs:line 393
at Npgsql.NpgsqlConnectorPool.RequestPooledConnectorInternal(NpgsqlConnection Connection) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlConnectorPool.cs:line 236
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlConnectorPool.cs:line 180
at Npgsql.NpgsqlConnection.Open() in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql\Npgsql\NpgsqlConnection.cs:line 639
at Npgsql.NpgsqlServices.UsingPostgresDBConnection(NpgsqlConnection connection, Action1 action) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql.EntityFramework\NpgsqlServices.cs:line 164 at Npgsql.NpgsqlServices.GetDbProviderManifestToken(DbConnection connection) in c:\dev\TeamCity\buildAgent\work\45caad201a245970\Npgsql.EntityFramework\NpgsqlServices.cs:line 102 at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) --- End of inner exception stack trace --- at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) --- End of inner exception stack trace --- at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.<>c__DisplayClass1.<ResolveManifestToken>b__0(Tuple3 k)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection)
at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
at System.Data.Entity.Internal.RetryLazy2.GetValue(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext() at System.Data.Entity.Infrastructure.DbQuery1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable1 source, Expression1 predicate)
at Minerva.Tests.Models.DiagnosisDbContextTest.DrugCodes_ByProductName_ReturnsMany() in c:\Users\Andrew\Source\Repos\Minerva\Minerva.Tests\Models\Entities\DiagnosisDbContextTest.cs:line 56

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.