Fluentnhibernate and PostgerSQL, SchemaMetadataUpdater.QuoteTableAndColumns - System.NotSupportedException: Specified method is not supported.

Original Post Vyacheslav's Avatar

Vyacheslav

13 Mar, 2010 01:44 PM via web

Hello! I'm using fluentnhibernate with PostgreSQL. PosrgreSQL version is 8.4.
My code for create ISessionFactory:

public static ISessionFactory CreateSessionFactory()
{
        string connectionString = ConfigurationManager.ConnectionStrings["PostgreConnectionString"].ConnectionString;
        IPersistenceConfigurer config = PostgreSQLConfiguration.PostgreSQL82.ConnectionString(connectionString);

        FluentConfiguration configuration = Fluently
            .Configure()
            .Database(config)
            .Mappings(m =>
                m.FluentMappings.Add(typeof(ResourceMap))                                    
                                .Add(typeof(TaskMap))
                                .Add(typeof(PluginMap)));
        var nhibConfig = configuration.BuildConfiguration();
        SchemaMetadataUpdater.QuoteTableAndColumns(nhibConfig);
        return configuration.BuildSessionFactory();
}

For auto-quote I was added method SchemaMetadataUpdater.QuoteTableAndColumns(nhibConfig);
When I'm execute code at line SchemaMetadataUpdater.QuoteTableAndColumns(nhibConfig); throw error: System.NotSupportedException: Specified method is not supported. Help me, please! I'm very need for solution.
Best regards

  1. Support Staff 2 Posted by James Gregory on 17 Mar, 2010 10:24 AM

    James Gregory's Avatar

    This is an NHibernate issue. It sounds like the dialect/driver for PostgreSQL doesn't have this particular functionality implemented; this is one of the reasons this behaviour isn't enabled by default in Fluent NHibernate.

    You should raise an issue on their bug tracking.

    In the meantime, you can update your mappings to explicitly quote your columns and table names using the Column and Table methods.

  2. James Gregory resolved this discussion on 17 Mar, 2010 10:24 AM.

Comments are currently closed for this discussion. You can start a new one.