Skip to main content

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 fact is that after 2.0.13-beta1, we had a lot of changes. From performance tweaks to better Entity Framework support and many other changes that we decided to skip 2.0.13 and call it Npgsql 2.1! Yes, you read it right. After so many years in the 2.0.x versions, we will ship our first 2.1 version. I'll post more info about it in a future post. I hope this version number change doesn't give too much confusion.

You can grab Npgsql 2.0.14 from nuget repository. You can install it directly from Visual Studio and Xamarin Studio through Nuget Package Manager.

We are also packing zip distributions to put on our downloads section. We are having some problems with our downloads host but as soon as we get them available I'll update this post. They are already available at pgfoundry and github.

As always, send your comments and feedback about this release. They are very welcome and will help us to get more goodies in your hands on next releases.


Comments

Unknown said…
i'm get this error:

The 'Instance' member of the Entity Framework provider type 'Npgsql.NpgsqlServices, Npgsql, Version=2.0.14.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'. Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance of the provider. This may be because the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

this means that this version does not support version 6.x of the Entity Framework?
tryhp3 said…
What version of the Entity Framework is supported?
brm said…
I have the same error, is not supported?
any solution?
Npgsql 2.0.14 doesn't have support for EF6. It has support for EF 4.3.1. More information about how to use it you can find here: http://fxjr.blogspot.com.br/2013/06/npgsql-code-first-entity-framework-431.html.

EF6 support will be in the upcoming 2.1 version. You can grab a current snapshot from github which has support for EF6 from here: https://github.com/npgsql/Npgsql/archive/master.zip

You will need to compile it on visual studio and grab the resulting assemblies from the Npgsql.EntityFramework/bin folder.

I hope it helps.

Please, let me know if you have any problem.
Unknown said…
This comment has been removed by the author.
Unknown said…
Would it be possible to upload a 2.1 Alpha version in nuget with EF6 support?
tryhp3 said…
I use PostgreSQL 9.3

Combination Npgsql 2.0.12.1 and EF 4.3.1, works well for me.

Combination Npgsql 2.0.14.1 and EF 4.3.1 throw error:

An unhandled exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll

Additional information: The provider did not return a ProviderManifest instance.

Message: Value cannot be null.
Parameter name: input

StackTrace:
at System.Xml.XmlReaderSettings.CreateReader(Stream input, Uri baseUri, String baseUriString, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(Stream input, XmlReaderSettings settings, String baseUri)
at System.Xml.XmlReader.Create(Stream input)
at Npgsql.NpgsqlProviderManifest.CreateXmlReaderForResource(String resourceName) in c:\C#Apps\github.npgsql.Npgsql.stock\src\Npgsql\NpgsqlProviderManifest.cs:line 265
at Npgsql.NpgsqlProviderManifest..ctor(String serverVersion) in c:\C#Apps\github.npgsql.Npgsql.stock\src\Npgsql\NpgsqlProviderManifest.cs:line 14
at Npgsql.NpgsqlServices.GetDbProviderManifest(String versionHint) in c:\C#Apps\github.npgsql.Npgsql.stock\src\Npgsql\NpgsqlServices.cs:line 107
at System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken)

TargetSite:{System.Data.Common.DbProviderManifest GetProviderManifest(System.String)}

What is wrong?
Hi Scott Xu!

We are working to release a beta of 2.1 soon! You can give it a try today by download the latest code from github at: https://github.com/npgsql/Npgsql/archive/master.zip
Hi Piotr Trychta.

This was a little error in the assembly building. We already uploaded a new version to nuget. Please, check it out and let me know if it worked for you.

Thanks for feedback.
tryhp3 said…
This comment has been removed by the author.
tryhp3 said…
This comment has been removed by the author.
tryhp3 said…
Npgsql 2.0.14.2 and EF 4.3.1 works for me.
Unknown said…
Thank you for all of your great work on Npgsql. I pulled and compiled latest source today from the git repository, and then referenced all assemblies in the EntityFramework project bin (release-net45). I'm trying to go code-first with EF6 to pg 9.3, but get the following error when enabling migrations.

Type is not resolved for member 'Npgsql.NpgsqlException,Npgsql, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'.

I don't think the config is off, but am still a bit unclear on whether or not database creation is even supported. My database does not yet exist.
Unknown said…
Scratch the prior questions. Simply adding the compiled assemblies to the GAC solved the type issue. I also understand that i need to create the db first before an initial migration. However, with that first migration of domain entities, I get the following exception. Any insight would be extremely helpful. Lateset builds of Npgsql and Npgsql.EntityFramework are both referenced.

"No MigrationSqlGenerator found for provider 'Npgsql'. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators."
Hi, Clay Turner.

We still don't have support for database migration or creation. But there is a pull request for that! Check out https://github.com/npgsql/Npgsql/pull/91 and give it a try. Let us know if it worked for you. This will be very helpful.

Thanks in advance.
Unknown said…
This comment has been removed by the author.
tryhp3 said…
This comment has been removed by the author.
SevZ said…
Francisco,

I'm trying to "Update Model From Database" with VS 2012, PG 9.0.8 and Npgsql 2.0.14.3 and EF 5.0.0.

I see this error:

---------------------------
Microsoft Visual Studio
---------------------------
An error occurred while connecting to the database. The database might be unavailable. An exception of type 'System.Data.ProviderIncompatibleException' occurred. The error message is: 'The store data provider failed to return information for the StoreSchemaDefinition request. See the inner exception for details.

The inner exception caught was of type 'System.ArgumentNullException', with this error message: 'Value cannot be null.

Parameter name: input'.'.
---------------------------
OK
---------------------------

Despite the message saying that the db might be unavailable, I'm sure that the connection to postgres is being correctly established because I see it in the PG logs.

Can you help out? Where can I look to troubleshoot this?

-Sev
Hi, Sev!

Unfortunately Npgsql still doesn't have support for Update Model from Database. We are working on this support on github: https://github.com/npgsql/Npgsql/pull/91

Sorry for the inconvenience.
Unknown said…
hey sevz,
In my case, S Clay Turner's solution also solved that error message. I was able to generate the edmx model using Visual Studio 10, Postgres 9.3,Npgsql 2.0.14.3.

"Simply adding the compiled assemblies to the GAC solved the type issue"

you can try if it works.
SevZ said…
David Antenor,

Thanks for your input!

I found that Visual Studio 2013 (v12) has an issue creating schema from database when 3rd party providers are used.

https://entityframework.codeplex.com/workitem/1869

So I guess I have to continue to use Visual Studio 2012 to generate schema from database.

-Sev
Unknown said…
I used visual studio 2010 rather.
[Npgsql.Provider2] + [Npgsql-2.0.14.3] projects in debugging mode to launch a new visual studio instance. compiled the assemblies (in Debug4 folder) again using the gacutil. from there I was able to Update from Database (existing postgres db). I guess it still doesn't work on newer versions of visual studio. I'm still new to this
Hi,

We are currently in the process of migrating data to PostgreSQL Databases SQLServer

We are currently using the " Npgsql 2.0.12 " version of our system and we are detecting performance problems, as we have a situation similar to this : https://groups.google.com/forum/m/#!topic/npgsql-dev/Pl_-FfUQZ8I

Our systems have hundreds of simultaneous connections between 400 connections on less traffic days and 800 connections on more traffic days, we expect that this will increase.

When we tested yields pgbench work as expected.

These are the tests in a production server :

pgbench emp_bra_lctr -C- c 700- j 50 - T 60 -U postgres
starting vacuum ... end .
transaction type: TPC- B ( sort of)
scaling factor : 1
query mode: single
number of clients: 700
number of threads: 50
duration: 60 s
number of transactions actually processed : 8673
tps = 135.914877 (including connections Establishing )
tps = 138.361335 (excluding connections Establishing )

The configuration server is:
work_mem = 300MB
shared_buffers = 10GB # (change requires restart)
temp_buffers = 2GB
maintenance_work_mem = 2GB
max_connections 1000

Our server have a Linux Ubuntu 12.04 and the hardware is:

12 Cores
72 GB RAM

But using the " Npgsql 2.0.12 " our / s connector server does not work as expected, It is very slow when traffic up.

The question: In release 2.1 you have solved this problem? If not. Where I can check in the sources? In the ConnectionPool ?

Thanks
giaonhan247 said…
Thanks for sharing, nice post! Post really provice useful information!

An Thái Sơn chia sẻ trẻ sơ sinh nằm nôi điện có tốt không hay võng điện có tốt không và giải đáp cục điện đưa võng giá bao nhiêu cũng như mua máy đưa võng ở tphcm địa chỉ ở đâu uy tín.

Popular posts from this blog

UUID datatype and COPY IN/OUT support added to cvs

Hi all! It was just added support to uuid datatype in cvs head. This type will be available in next Postgresql release 8.3. Thanks to David Bachmann for his patch! You can get more info about this patch in this mailing list post . Also was added support for copy in and copy out operations. Now, users can provide streams which can be copied directly to and from Postgresql tables! Thanks to Kalle Hallivuori for providing a patch! Thanks to Truviso for giving support to Kalle. More info about that including a demo and ready to use compiled Npgsql.dll versions can be found here . That's it! As soon as we get more features added, I will post info about them here. Stay tuned! :)

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

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 how it