{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/132","labels_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/132/comments","events_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/132/events","html_url":"https://github.com/fsprojects/SQLProvider/issues/132","id":66093009,"number":132,"title":"Crash in PostgresqlProvider","user":{"login":"trondd","id":223591,"avatar_url":"https://avatars.githubusercontent.com/u/223591?v=3","gravatar_id":"","url":"https://api.github.com/users/trondd","html_url":"https://github.com/trondd","followers_url":"https://api.github.com/users/trondd/followers","following_url":"https://api.github.com/users/trondd/following{/other_user}","gists_url":"https://api.github.com/users/trondd/gists{/gist_id}","starred_url":"https://api.github.com/users/trondd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trondd/subscriptions","organizations_url":"https://api.github.com/users/trondd/orgs","repos_url":"https://api.github.com/users/trondd/repos","events_url":"https://api.github.com/users/trondd/events{/privacy}","received_events_url":"https://api.github.com/users/trondd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-03T06:58:34Z","updated_at":"2015-07-17T02:52:02Z","closed_at":null,"body":"I am not sure where the exact problem is, but I've provided a testcase to reproduce is. I am using a database created from the supplied sql scripts.\r\n\r\n\r\n    open System.Data\r\n    open System.Linq\r\n    open FSharp.Data.Sql\r\n\r\n    type sql = SqlDataProvider< \r\n              @\"Server=\",\r\n              Common.DatabaseProviderTypes.POSTGRESQL,\r\n              \"Npgsql.2.2.5/lib/net40\",\r\n              UseOptionTypes = true >\r\n\r\n    let getData =\r\n        let ctx = sql.GetDataContext()\r\n        let q = query { for record in ctx.``[public].[regions]`` do\r\n                    \r\n                        // This is ok\r\n                        //where (record.region_name =% \"Europe\")\r\n\r\n                        // This is not ok\r\n                        where (record.region_id = 1)\r\n\r\n                        select record.region_name.Value\r\n                        }\r\n        // Crash on the following statement\r\n        let l = Seq.toList q\r\n        l\r\n\r\n    [<EntryPoint>]\r\n    let main argv = \r\n        let l = getData\r\n        List.iter (fun e -> printfn \"%s\" e) l\r\n        0\r\n\r\n\r\nStack trace:\r\n\r\n[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Program ---> System.TypeInitializationException: An exception was thrown by the type initializer for <StartupCode$foobar>.$Program ---> System.Reflection.AmbiguousMatchException: Ambiguous matching in method resolution\r\n  at System.Reflection.Binder+Default.GetBetterMethod (System.Reflection.MethodBase m1, System.Reflection.MethodBase m2, System.Type[] types) [0x00000] in <filename unknown>:0 \r\n  at System.Reflection.Binder+Default.SelectMethod (BindingFlags bindingAttr, System.Reflection.MethodBase[] match, System.Type[] types, System.Reflection.ParameterModifier[] modifiers, Boolean allowByRefMatch, System.Object[]& arguments) [0x00000] in <filename unknown>:0 \r\n  at System.Reflection.Binder+Default.BindToMethod (BindingFlags bindingAttr, System.Reflection.MethodBase[] match, System.Object[]& args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] names, System.Object& state) [0x00000] in <filename unknown>:0 \r\n  at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 \r\n  at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 \r\n  at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 \r\n  at FSharp.Data.Sql.Providers.PostgresqlProvider.FSharp-Data-Sql-Common-ISqlProvider-CreateCommandParameter (System.String name, System.Object value, Microsoft.FSharp.Core.FSharpOption`1 dbType) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+createParam@308-2.Invoke (System.Object value) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+extractData@317-4T[System.Object].Invoke (Microsoft.FSharp.Core.FSharpOption`1 data) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+build@316-29[System.Object].Invoke (Int32 i, System.Tuple`4 tupledArg) [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Primitives.Basics.List.loop@171-14[Tuple`4] (Microsoft.FSharp.Core.FSharpFunc`3 f, Int32 n, Microsoft.FSharp.Collections.FSharpList`1 x) [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Primitives.Basics.List.iteri[Tuple`4] (Microsoft.FSharp.Core.FSharpFunc`2 action, Microsoft.FSharp.Collections.FSharpList`1 x) [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Collections.ListModule.IterateIndexed[Tuple`4] (Microsoft.FSharp.Core.FSharpFunc`2 action, Microsoft.FSharp.Collections.FSharpList`1 list) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+build@314-28T[System.Object].Invoke (System.String op, Microsoft.FSharp.Collections.FSharpList`1 preds, Microsoft.FSharp.Core.FSharpOption`1 rest) [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`4[System.String,System.String,FSharp.Data.Sql.ConditionOperator,Microsoft.FSharp.Core.FSharpOption`1[System.Object]]]].InvokeFast[FSharpOption`1,Unit] (Microsoft.FSharp.Core.FSharpFunc`2 func, System.String arg1, Microsoft.FSharp.Collections.FSharpList`1 arg2, Microsoft.FSharp.Core.FSharpOption`1 arg3) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+filterBuilder@311-2.Invoke (Microsoft.FSharp.Collections.FSharpList`1 _arg4) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+aux@346-3[System.Object].Invoke (Microsoft.FSharp.Collections.FSharpList`1 _arg5) [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Core.OptionModule.Iterate[FSharpList`1] (Microsoft.FSharp.Core.FSharpFunc`2 action, Microsoft.FSharp.Core.FSharpOption`1 option) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+build@314-28T[System.Object].Invoke (System.String op, Microsoft.FSharp.Collections.FSharpList`1 preds, Microsoft.FSharp.Core.FSharpOption`1 rest) [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`4[System.String,System.String,FSharp.Data.Sql.ConditionOperator,Microsoft.FSharp.Core.FSharpOption`1[System.Object]]]].InvokeFast[FSharpOption`1,Unit] (Microsoft.FSharp.Core.FSharpFunc`2 func, System.String arg1, Microsoft.FSharp.Collections.FSharpList`1 arg2, Microsoft.FSharp.Core.FSharpOption`1 arg3) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$FSharp-Data-SqlProvider>.$Providers.Postgresql+filterBuilder@311-2.Invoke (Microsoft.FSharp.Collections.FSharpList`1 _arg4) [0x00000] in <filename unknown>:0 \r\n  at FSharp.Data.Sql.Providers.PostgresqlProvider.FSharp-Data-Sql-Common-ISqlProvider-GenerateQueryText (FSharp.Data.Sql.Common.SqlQuery sqlQuery, System.String baseAlias, FSharp.Data.Sql.Schema.Table baseTable, System.Collections.Generic.Dictionary`2 projectionColumns) [0x00000] in <filename unknown>:0 \r\n  at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.convertExpression (FSharp.Data.Sql.Common.SqlExp exp, System.Collections.Generic.List`1 entityIndex, IDbConnection con, ISqlProvider provider) [0x00000] in <filename unknown>:0 \r\n  at FSharp.Data.Sql.Runtime.QueryImplementation.executeQuery (ISqlDataContext dc, ISqlProvider provider, FSharp.Data.Sql.Common.SqlExp sqlExp, System.Collections.Generic.List`1 ti) [0x00000] in <filename unknown>:0 \r\n  at FSharp.Data.Sql.Runtime.QueryImplementation+SqlQueryable`1[System.String].System-Collections-Generic-IEnumerable`1-GetEnumerator () [0x00000] in <filename unknown>:0 \r\n  at Microsoft.FSharp.Collections.SeqModule.ToList[String] (IEnumerable`1 source) [0x00000] in <filename unknown>:0 \r\n  at <StartupCode$foobar>.$Program..cctor () [0x00000] in <filename unknown>:0 \r\n  --- End of inner exception stack trace ---\r\n  at Program..cctor () [0x00000] in <filename unknown>:0 \r\n  --- End of inner exception stack trace ---\r\n"},"comment":{"url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/comments/122154827","html_url":"https://github.com/fsprojects/SQLProvider/issues/132#issuecomment-122154827","issue_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/132","id":122154827,"user":{"login":"psfblair","id":176193,"avatar_url":"https://avatars.githubusercontent.com/u/176193?v=3","gravatar_id":"","url":"https://api.github.com/users/psfblair","html_url":"https://github.com/psfblair","followers_url":"https://api.github.com/users/psfblair/followers","following_url":"https://api.github.com/users/psfblair/following{/other_user}","gists_url":"https://api.github.com/users/psfblair/gists{/gist_id}","starred_url":"https://api.github.com/users/psfblair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psfblair/subscriptions","organizations_url":"https://api.github.com/users/psfblair/orgs","repos_url":"https://api.github.com/users/psfblair/repos","events_url":"https://api.github.com/users/psfblair/events{/privacy}","received_events_url":"https://api.github.com/users/psfblair/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T02:52:02Z","updated_at":"2015-07-17T02:52:02Z","body":"Thanks! Any idea when we might get a new version in NuGet (or an official release)? It looks like the version that's currently out there is from May 2014. It would be nice if the version available from NuGet didn't have this issue. "}}