by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 21:30
    roji commented #2307
  • Jan 31 2019 20:35
    YohDeadfall commented #2307
  • Jan 31 2019 10:20
    capan starred npgsql/npgsql
  • Jan 31 2019 06:10
    SeanFarrow synchronize #2308
  • Jan 30 2019 20:37
    austindrenski commented #2308
  • Jan 30 2019 20:37
    pentagra commented #1445
  • Jan 30 2019 20:33
    SeanFarrow commented #2308
  • Jan 30 2019 20:31
    austindrenski commented #2308
  • Jan 30 2019 20:27
    SeanFarrow commented #2308
  • Jan 30 2019 20:09
    austindrenski labeled #2308
  • Jan 30 2019 20:05
    roji commented #1520
  • Jan 30 2019 19:50
    gyzod commented #1445
  • Jan 30 2019 19:06
    SeanFarrow commented #1520
  • Jan 30 2019 18:54
    roji commented #1520
  • Jan 30 2019 18:53
    roji commented #1520
  • Jan 30 2019 18:52
    roji commented #2050
  • Jan 30 2019 18:45
    Trolldemorted commented #2050
  • Jan 30 2019 18:21
    SeanFarrow commented #1520
  • Jan 30 2019 18:16
    SeanFarrow review_requested #2308
  • Jan 30 2019 18:16
    SeanFarrow review_requested #2308
pm64
@pm64
@patricedejaeghere unfortunately this channel isn't terribly active
You might try opening an issue on Github
Rodrigue Van Brande
@Rodriguevb
Rodrigue Van Brande
@Rodriguevb
Etui-iPhone.com 📱
@etuiiphone_twitter
Hello, i would like to know if there is a way to use the SELECT DISTINCT ON COLUMN_NAME function in EF Core ? I cannot use it.
Árthur Tolfo Pinheiro
@arthur-pinheiro
Hello everyone! Is there any guide for debugging the source code? I'm trying to fix a bug related in here: npgsql/efcore.pg#438 Thanks
Simon Novak
@snovak7
hmm, what it's like to use a "decimal" type?
more than 28 decimal places?
win32nipuh
@win32nipuh
I port my ASP.NET Core 3.1 web application from using SqLite to PostgreSQL. I have added the Npgsql.EntityFrameworkCore.PostgreSQL, but when I run the app I receive the error:
{"The database provider attempted to register an implementation of the 'IRelationalTypeMappingSource' service. This is not a service defined by EF and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices'
What may be the reason?
How to fix it?
Shay Rojansky
@roji
@win32nipuh you're most likely mixing versions of EF Core and EFCore.PG, make sure all versions are aligned to the same minor version. Otherwise open an issue and post your csproj.
win32nipuh
@win32nipuh
@roji I think: probably I need to add yet Npgsql.EntityFrameworkCore.PostgreSQL.Design package?
win32nipuh
@win32nipuh
I have created an issue:
Shimmy
@weitzhandler
Shay Rojansky
@roji
Everyone, sorry I haven't been very active recently on this channel - will do my best to follow more closely.
If anyone posted a question and didn't get a response, and you're still stuck, please repost and I'll do my best to help
Shimmy
@weitzhandler
@roji you're one of the most responsive people in the OSS community. Plus your stuff are ingenious! Here's a chance for me to say thanks for everything 💖
pm64
@pm64
Yes huge thanks @roji for all you do ❤️❤️
Alberto Passalacqua
@AlbertoPa
:thumbsup: so true
Shay Rojansky
@roji
Wow, thanks guys :) It really means a lot to hear this, seriously.
Shimmy
@weitzhandler
באהבה @roji
I'm upgrading to .NET 5 on a new project I'm working on, and I'm wondering if the Npgsql.Json.NET package is required at all, or System.Text.Json is already complete which makes this package and Json.NET redundant entirely?
Shay Rojansky
@roji
System.Text.Json doesn't exactly provide all the features of Json.NET (but is much more efficient). There are a few pages out there that compare them (e.g. https://medium.com/@samichkhachkhi/system-text-json-vs-newtonsoft-json-d01935068143, the official migration guide could be useful too: https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to)
I'd default to trying System.Text.Json and falling back to Json.NET if you had any walls. The EF Core provider only supports System.Text.Json (at least at the moment), and the Npgsql ADO.NET driver supports both (with Json.NET requiring a plugin)
7 replies
Shimmy
@weitzhandler
That makes perfect sense, thank you @roji.
And another question
https://github.com/npgsql/efcore.pg/issues/774#issuecomment-661665981
Shay Rojansky
@roji
You're welcome - answered in the thread.
Shimmy
@weitzhandler
👑
Andre Pereira da Silva
@andrepersilva_gitlab
hi, ever one I need help for property name I try to executed composite type, I will migrate sql server to postgree and I need change minimal code, but I have property like PaymentTypeID I have error : 'While trying to write an array, one of its elements failed validation. You may be trying to mix types in a non-generic IList, or to write a jagged array.', but if I change the name for upper or lower it´s work, i want't use [Pgname] because i will change many, many code, thks
Yoh Deadfall
@YohDeadfall
Hi @andrepersilva_gitlab , there is NpgsqlNullNameTranslator if you have the same names in the database as in POCOs. Take a look at Name translation in http://www.npgsql.org/doc/types/enums_and_composites.html.
Andre Pereira da Silva
@andrepersilva_gitlab
tks a lot, it's work.
Alejandro Sanchez Jimenez
@eGode_gitlab
Hi, what is the different between use await or not when open a connection with npgsql? What is the best opcion?
Parthiban
@ParthiKarnan

Hello All,
I'm new to PostgreSQL, Recently that I'm building microservices project using ASP.NET Core 3.1 Web API with EF Core using PostgreSQL.
When I Update-Database command in Package Manager Console I'm getting the below error message.

Npgsql.NpgsqlException (0x80004005): Exception while connecting
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<>cDisplayClass32_0.<<Open>gOpenLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Npgsql.NpgsqlConnection.Open()
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>cDisplayClass0_0.<.ctor>b0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Exception while connecting

1 reply
I used to do Add-Migration InitialCreate and Update-Database command often. It's been working fine.
Today suddenly I got the above error message. Kindly let me know if anybody gone through the same issue or any solution.
Weboholics
@Weboholics
Hi, I need to use stored procedures - by calling by name, because we support both ms sql and postgre in our product. Are there any plan for npgsql driver to support it in version 5?
4 replies
Alberto Passalacqua
@AlbertoPa
@ParthiKarnan local connection or remote?
Parthiban
@ParthiKarnan
@ParthiKarnan local connection or remote?
@AlbertoPa
It's my local environment. I'm using my laptop.
Shay Rojansky
@roji
@eGode_gitlab you're basically asking about using asynchronous or synchronous I/O, which is a very general .NET question. Simply put, async allows you to wait for potentially long operations (e.g. opening a connection to PostgreSQL) without blocking a thread - this can be important for scalability/perf. I'd suggest reading any of the general tutorials on what async means in .NET.
@ParthiKarnan this means that Npgsql couldn't connect to PostgreSQL. Check that your config is correct, i.e. that you're connecting to the right server, with the right port. Compare with other client (e.g. psql, pgadmin...)
Note that unlike Update-Database, Add-Migration doesn't ever contact the database, so it will always work - it only creates a new migration file locally.
Andre Pereira da Silva
@andrepersilva_gitlab
how I can execute procedure in dapper, the code it´s work in sql server but if use Dapper.SqlMapper.Execute(, I have error like 42601 or if I used CommandType.StoredProcedure I received error 42809
Shay Rojansky
@roji
@andrepersilva_gitlab I personally don't know Dapper very well, try posting a question (with a code sample) on stackoverflow
Tim
@t-smirnov
hi there, could you tell me, is there any proper way to drop db via npgsqlConnection after tests run?
Yoh Deadfall
@YohDeadfall
@andrepersilva_gitlab The answer was given a bit higher. See thread https://gitter.im/npgsql/npgsql?at=5f1d4726bc41f36817261991
@t-smirnov hi, just connect to database postgres and execute DROP DATABASE. You can take at EF Core for an example - https://github.com/npgsql/efcore.pg/blob/95bced395fd5f98359782855c98b48cfd5522edf/src/EFCore.PG/Storage/Internal/NpgsqlRelationalConnection.cs#L47-L67
Andre Pereira da Silva
@andrepersilva_gitlab
how can I return mutiples results set from function , I received "<unnamed portal 4>" and "<unnamed portal 5>" ?
Shay Rojansky
@roji
@andrepersilva_gitlab for now you have to manually "dereference" these cursors with FETCH: https://www.postgresql.org/docs/current/sql-fetch.html
npgsql/npgsql#1785 tracks having Npgsql do this automatically for you (npgsql/npgsql#438 is an earlier issue which contains additional info)