Exception : Entity Framework 6 on PostgreSQL RRS feed

  • Question

  • I have been developing ASP.NET MVC 4 application using PostGreSQL database.  I'm stuck up with the below issue over a week. So, i need your valuable help on this.

    Referenced Packages:

    "Npgsql" - Npgsql is the opoen source .NET data provider for PostgreSQL.
    "Npgsql for Entity Framework 6" - PostgreSQL provider for Entity Framework 6.
    Below exception occurs when calling the SimpleMembership provider.

    postgresql log:

    2018-01-19 09:00:30 IST [14320]: [1-1] user=postgres,db=PatientScheduler,app=[unknown],client= ERROR:  syntax error at or near "[" at character 14

    2018-01-19 09:00:30 IST [14320]: [2-1] user=postgres,db=PatientScheduler,app=
    [unknown],client= STATEMENT:  CREATE TABLE [UserProfile]([UserId] int NOT NULL PRIMARY KEY IDENTITY, [UserName] nvarchar(56) NOT NULL UNIQUE)

    Stack Trace:

    [PostgresException (0x80004005): 42601: syntax error at or near "["] Npgsql.NpgsqlConnector.DoReadMessage(DataRowLoadingMode dataRowLoadingMode, Boolean isPrependedMessage) +311 Npgsql.NpgsqlConnector.ReadMessageWithPrepended(DataRowLoadingMode dataRowLoadingMode) +272 Npgsql.NpgsqlConnector.ReadExpecting() +29 Npgsql.NpgsqlDataReader.NextResultInternal() +296 Npgsql.NpgsqlDataReader.NextResult() +184 Npgsql.NpgsqlCommand.Execute(CommandBehavior behavior) +906 Npgsql.NpgsqlCommand.ExecuteNonQueryInternal() +134 WebMatrix.Data.Database.Execute(String commandText, Object[] args) +129 WebMatrix.WebData.SimpleMembershipProvider.CreateTablesIfNeeded() +309 WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +86 WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +88 PatientSchedulingSystem.Filters.SimpleMembershipInitializer..ctor() in d:\Projects\PatientSchedulingSystem\PatientSchedulingSystem\Filters\InitializeSimpleMembershipAttribute.cs:41

    The Entity Framework is not generated scripts based on PostgreSQL standard.

    Tuesday, January 23, 2018 6:51 AM

All replies

  • Hi Shaik Yassir Arafath,

    According to your description, you encounter the issue when you calling the SimpleMembership provider, which is related to asp.net. I would suggest that you could post your issue on asp.net forum for suitable support.


    In addition, you use npgsql with entity framework, you could also post your issue on the following link.


    Thanks for your understanding.

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 23, 2018 8:45 AM
  • Thanks for the information.
    Tuesday, January 23, 2018 10:11 AM