Skip to main content

Posts

Happy 20th Anniversary, Npgsql!

      Happy 20th Anniversary, Npgsql!      It seems like yesterday when I decided to start Npgsql. And today, Npgsql completes 20 years since the first public beta release!     On May 18th, 2002, this is what was written in the first release notes of Npgsql  version 0.1:   2002-05-18          First Npgsql beta release.     In this version there is a limited functionality. It is only possible to connect and disconnect from server.     Only clear text authentication is supported right now.     To compile you can use the SharpDevelop to open the Combine file (Npgsql.cmbx) or type at command console: csc /t:library /out:Npgsql.dll NpgsqlConnection.cs AssemblyInfo.cs NpgsqlException.cs This will create the file Npgsql.dll that can be copied to the application directory.     I will be working in the Command functionality now.     ...

It's been a long time....

Hi, all!! It's been a long time since the last time I posted here... Wow, almost 6 years!!  What have I been doing all this time, you may wonder... Well, I've been studying a lot and playing with other projects besides Npgsql, which btw is in excellent Shay Rojansky's hands.  So, what I've been up to, you may ask? Well... I've been playing with mobile development. More specifically Android Development. And I've already published some apps to Play Store. I'll talk more about them in future posts. Just wanted to let you know that I'm back to blogging and will keep posting about my projects again.  Thanks for reading!

Npgsql 2.2.0 final release is out!

This is Npgsql 2.2.0 Final Release This release contains 249 commits since the last stable release. Includes bug fixes, improvements and new features. Update notice: If you have been using Npgsql 2.2.0-rc2, you don't need to update to this version. They are the same except for the Assembly version information. Major highlights Visual Studio DDEX support   Kenji Uno added support for DDEX. Now you can use Npgsql with Visual Studio data designer. This is a missing feature a lot of our users requested in the past. Kenji added a tutorial about how to use Npgsql with DDEX. You can find it here: https://github.com/npgsql/Npgsql/wiki/Visual-Studio-Design-Time-Support---DDEX-Provider#install-npgsqlddexprovidervsix   Entity Framework   David Karlaš added support for EFMigration and Database creation in EF6+. Now it is possible to start Code First projects without needing to create a database upfront. EntityFramework and Npgsql will take care of it. E...

Npgsql 2.2.0 Release Candidate 1 released!

This release contains 22 commits since the last release. It contains the following bug fixes: [ #217 ] Impossible to insert a Double.NaN value [ #179 ] NpgsqlCommandBuilder automatic sql commands configuration [ #158 ] NpgsqlCommand.Dispose() should execute "DEALLOCATE " for a prepared command [ #264 ] Mono.Security is outdated [ #296 ] parameter parsing fails (regression) and duplicate [ #240 ] NpgSqlCommand does not substitute parameters when there is a string with escaped apostrophe A complete list of commits for this release can be found here: v2.2.0-beta1...release-2.2.0

Npgsql 2.2.0 beta1 released!

The Npgsql Development team is proud to announce that Npgsql 2.2.0 beta1 is now available! This release has the following highlights: Visual Studio DDEX support Kenji Uno added support for DDEX. Now you can use Npgsql with Visual Studio data designer. This is a missing feature a lot of our users requested in the past. Kenji added a tutorial about how to use Npgsql with DDEX. You can find it here . Support for EFMigration and Database creation in EF6+ David Karlaš added support for that. Now it is possible to start Code First projects without needing to create a database upfront. EntityFramework and Npgsql will take care of it. Emil Lenngren added support for a lot of missing features of EntityFramework. Check out this list containing fixes from David and Emil as well as others for EntityFramework. SSLStream support In this release, SSLStream is on by default. If you want to use Mono.Security, you will need to use the following line in your code: NpgsqlC...

Initial Visual Studio Design time support added to master branch!

Achievement unlocked! With the merge of Pull Request #213  (PR #213), Kenji Uno added support for Visual Studio Design Time also known as DDEX.  A most wanted feature From the statistics of pageviews I get from a previous post about design time support, I can affirm that this is a most wanted feature of Npgsql. And I'm very glad to say that Npgsql is finally having it. I'd like to thank Kenji Uno for all his hard work to make this happen.  Npgsql DDEX support is done through an extension file which can be easily installed in Visual Studio. This is a much better situation than we had before where it was needed to use an experimental instance of Visual Studio.  History The code started with wwindcloud in PR #67 and Kenji started to play with it and said he was working to get it usable in VS2012 and 2013 .  Some time later, Kenji said he had some success to get Npgsql DDEX initially working and started to fix the bugs he was fi...

Npgsql 2.1.3 released!

This version restores the @@ operator support removed in the previous version. Thanks Glen Parker who provided a fix. Downloads can be found at the usual locations: github download page and the nuget repository . Pgfoundry will be updated soon.

Npgsql 2.1.2 released!

Npgsql 2.1.2 is out! This is a bug fix release. Two fixes are present: KeyNotFoundException when setting ApplicationName on NpgsqlConnectionStringBuilder and  A regression when using NHibernate with queries containing '<' operator. (Less Than' prepare failing). Unfortunately, this fix breaks previous support for @@ operators. So if you need this support, you will have to use the previous 2.1.1 version. Glen Parker is working in a permanent fix. Sorry for this big inconvenience. More info about that can be found at the link above. Please, give it a try and let me know if you have any problems. Please, report your issues in our github issues page .

Npgsql 2.1.0 released!

After a long time, Npgsql 2.1.0 is finally released!  If you have been following my posts about Npgsql 2.1 beta and rc releases, you know we did a lot of changes since our last stable release. The change log for this version is big. You can find a complete list of what has changed and the bugs fixed in the github project release page . It has a lot of information about the changes we made since our last stable 2.0.14 release. You should check it out to see what changed and what new features you will get when you use 2.1. Developers using Npgsql 2.1 and Entity Framework should pay attention to the changes related to new configuration settings. More information about those changes can be checked here . Downloads are available on Nuget , github . pgfoundry downloads will be made available soon. Finally, I'd like to thank some people who did an incredible job and that without them this release wouldn't be possible! Glen Parker has been working in the optim...

Npgsql 2.1 Release Candidate 1 released!

Today we released Npgsql 2.1 RC1. This release has very few fixes since Beta1. In fact, only two: Fixed bugs: #141 AlwaysPrepare does not works in some cases. Thanks @avb1987. #153 Fixed wrong comma putting in AddFunctionColumnListSupport(). Thanks @tyler-nguyen. The changelog of the Beta1 is way bigger and has a lot of information about the changes we made since our last stable 2.0.14 release. You should check it out to see what changed and what new features you will get when you use 2.1. We will have the final version release in the beginning of March. Downloads are available on Nuget, github and pgfoundry. You may want to check my previous post  about how to get Npgsql 2.1 beta1. The instructions there also apply to 2.1 rc1. Please, give it a try and let us know what you think. Drop by our user forums  to discuss or send your bug reports to our issues section on github. 

How to get Npgsql 2.1.0 beta

In my last post , I talked about how to use Npgsql 2.1.0 and showed an App.config file which you could use as a template for your applications which use Entity Framework 6. Npgsql 2.1.0 didn't have a stable release yet. It is currently in beta (and shortly in RC). You can download it from the following sources: Nuget As already mentioned, Npgsql 2.1.0 didn't have a stable release yet, so you will need to ask Nuget to install a pre-release version of Npgsql. You do that with the following nuget command: PM> Install-Package Npgsql -Pre If you plan to use Entity Framework 6, you will also need to download the Npgsql.EntityFramework assembly. This is done with the following nuget command: PM> Install-Package Npgsql.EntityFramework -Pre If you plan to use Entity Framework 4.x, you will need to download  Npgsql.EntityFrameworkLegacy . Install it with the following nuget command: PM> Install-Package Npgsql.EntityFrameworkLegacy -Pre ...

Using Entity Framework 6 with Npgsql 2.1.0

UPDATE (2014-05-19): Marek Beneš noticed a problem in the default connection factory config. It is fixed now. Thanks, Marek! UPDATE (2014-02-20): I created a new post explaining how to get Npgsql 2.1.0. Although this post is about EF 6, I'd like to talk about our current situation to support both EF 6 and EF4.x which explain why there are some subtle changes between EF 4.x and EF 6.x App.config settings.  Support for EF versions 4.x and 6.x Sometime after we started to work on Npgsql 2.1.0, we started to add code to support EF6 and decided to reorganize our Entity Framework support code. Shay created a pull request to organize this change and isolate the EF code out of core Npgsql code. The result was the creation of two separated assemblies: Npgsql.EntityFramework.dll for EF6 and above; Npgsql.EntityFrameworkLegacy.dll for EF4.x. Only when using Npgsql with EF6 you will need to reference Npgsql.EntityFramework.dll assembly. This is needed because the EF ...

New developer and user discussion groups available!

Npgsql has new developers and users communication channels. Shay Rojansky created two new discussion groups for Npgsql: npgsql-dev and npgsql-help . Those groups will be used in place of the Npgsql-devel mailing list and the forums available on pgfoundry.org  respectively. Please, feel free to send your questions and comments to those groups. We hope those groups are very helpful to users looking for Npgsql support.

Npgsql 2.0.14 released!

Update (2013-12-22): 2.0.14.3 was released with a fix for entity framework boolean value handling. See this issue  and this commit for more info about this fix. Package zip files are already available from pgfoundry  and github . * * * After a lot of time since last stable release, Npgsql 2.0.14 is out! This is a small bugfix release with fix for hangs which could happen when connecting to Postgresql 9.3.  This bug appeared when Postgresql sent an error message. Npgsql had a problem handling some error code fields and then hang while processing it. Whooops! :)  Thanks to Glen Parker, it is  fixed on github .  If you are having hang problems while using Npgsql after upgrade the server to 9.3 version, this version is for you. 2.0.14? Those who are paying attention to the version number may have noticed that the version number is 2.0.14 and not 2.0.13 as it should be. After all, we already had a 2.0.13-beta1 released .  The ...

SSLStream support added to Npgsql!

Yesterday I merged a pull request which adds support to .Net SSLStream in Npgsql. When Npgsql development started, in 2002, there was no SSL support in .net 1.0 and 1.1. It was added later in .net 2.0 but the support to SSLStream was never added to Npgsql. This all changed a few weeks ago when  Dave G created a patch which adds support to .Net SSLStream in Npgsql. He also said that one of the motivations was the fact that the current SSL support was returning error when using client certificate authentication. (I'll post a tutorial about how to use client certificates later) There is a very old feature request  (like since 2005!) to somehow create a single Npgsql.dll which incorporates Mono.Security.dll assembly. This would easy the deployment of Npgsql and version control. This feature request generated a discussion about the removal of Mono.Security dependency and possible impact in current user code.  In order to get the lowest impact by this change...

2.0.13-beta1 Nuget packages available!

After a long delay, Nuget packages for 2.0.13-beta1 are finally available! Since they are beta, you will need to use a command line parameter when installing this package. According to Nuget , you will need to use the following command: PM> Install-Package Npgsql -Pre Please, give it a try and let me know if it works ok. This package also fixes  the problem of police files compiled to .Net 2.0 framework only. This was giving problems when installing Npgsql on .net 4.0 runtimes. Thanks  Yusuke Fujiwara for fixing it.

Npgsql 2.0.13 beta1 released!

Today we released the first beta of Npgsql 2.0.13!  This new beta release had a lot of bugs fixed and initial support for Entity Framework 6! More information about how to use Entity framework 6 with Npgsql can be found in  this post . Checkout the release notes for more information about the bugs fixed in this release. Download it from our  downloads section . Important notice about this release Unfortunately, I made a mistake when updating the assembly version for this release and it was created with a wrong value. I'm very sorry for that. This release should have been 2.0. 12 .91 and not 2.0. 13 .91 Next beta release will have the version value fixed. What are the implications?  The biggest problem is that this beta version will have a version number higher than the final 2.0.13 version while this beta version has 2.0.13.91. As it is a beta and it is not supposed to be deployed in production systems, we think this won't give pr...

Performance improvements when creating NpgsqlConnection objects

Recently,  I applied a patch from  Kevin Pullin  which will improve the performance of programs using Npgsql. This patch reduces significantly the time to create new NpgsqlConnection objects. This particularly applies in scenarios where you are creating and disposing a lot of NpgsqlConnection objects, like when  you are using connection pool , ( you are using it, right? :) ). Comparison test I made an artificial test to show the impact of this patch. This test consists of a simple loop where I create 10k NpgsqlConnection objects.  class   Program     {          static   void   Main ( string []  args )         {              var   connString   =   "server=127.0.0.1;userid=npgsql_tests;database=npgsql_tests;" ;        ...

Initial EF-6 support added to Npgsql

In my last post , I said there is a pull request by Pēteris Ņikiforovs to add support for EF-6 to Npgsql. Yesterday, I merged this pull request to the master branch of Npgsql . With this merge, Npgsql has officially initial support for EF-6! How to compile For now, in order to compile Npgsql to use EF-6, you have to open the solution file NpgsqlEF6.sln. Later,  as suggested by Pēteris Ņikiforovs , the idea is that we create a new configuration inside main project solution instead of maintain 2 separated projects. Another thing you will need to compile Npgsql is the latest release of EntityFramework assembly through NuGet: PM> Install-Package EntityFramework -Pre That's it! Now you will be able to play with Npgsql and EF-6. Check out my previous post about how to use Npgsql with EntityFramework. I'd like to thank Pēteris Ņikiforovs for his patch. And maxbundchen for his patch about Open/Close events needed for EF-6. Please, give it a try and let me know ...

Npgsql Code First Entity Framework 4.3.1 Sample

After reading the excellent article about entity framework on Postgresql by Brice Lambson, I decided to write this post to document my experience playing with Entity Framework 4.3.1 and Npgsql. This post will be an adaptation of the Code First To a New Database walkthrough in order to make it work with Npgsql.  First Steps You should follow the first 4 steps of Code First To a New Database. Go ahead, I''l wait for you. Next steps Here is where the adaptation of the walkthrough begins. As Brice noted in his post, Npgsql currently doesn't support database creation. ( I'm working on that and hope to get news about it soon.) So, for while, you have to create the database manually. Those are the steps you have to do to create the database and the model: First, run this command in the terminal to create the database (or you can use pgAdmin if you prefer a GUI): > createdb ef_code_first_sample  After that, you have to run the following commands ...