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
Hai Nguyen
@hainguyen0011
Hello guys, I'm in a project at my university that need to work with spatial data which is geometry type (linestring). And I chose ASP .Net core 3.1 mvc to work with.
I have connected to postgres successfully. my database have 1 table which has fields as above
and now I dont know how to put that data in my view. I've try to get the geometry directly but it throw an exception about CordinateSystem type
Robert Karlsson
@Robban1980
@hainguyen0011 a tip for when asking for help is to provide the error you get
Hai Nguyen
@hainguyen0011
So guys please tell me how can I put that geometry linestring type to view
Thank you very much, I'm appriciate
P/s: sorry about my bad english
Robert Karlsson
@Robban1980
CREATE OR REPLACE VIEW public.my_new_view AS SELECT my_columns FROM table;
thats how you create a view
Hai Nguyen
@hainguyen0011
so for each id I'will have a view right ?
Robert Karlsson
@Robban1980
If that is your requirement sure, but it does not make sense
Hai Nguyen
@hainguyen0011
anyway an exception I told about is
image.png
and I cant find it on internet
I dont know my direction is right or wrong I just try to do it on asp.net core 3.1
Robert Karlsson
@Robban1980
@hainguyen0011 did you read the manual?
Hai Nguyen
@hainguyen0011
I have read manual on npgsql .org
Robert Karlsson
@Robban1980
https://www.npgsql.org/doc/types/geojson.html even the part about how to read an write that type of value?
Hai Nguyen
@hainguyen0011
I found it cant help me so I dont follow the guide
thank you for spending time response me
Yoh Deadfall
@YohDeadfall
Have you set up the plugin? Any code?
ruslanen
@ruslanen
image.png

Hello! Tell me please. I have the following situation:

  1. I open a connection to server A and send a test request
  2. After server B starts to process the request, I simulate a loss of connection with server B
    (just setting up a rule for iptables on server B that does something like iptables -A OUTPUT -p tcp --dport {ephemeral_port_number} -j DROP)
  3. After 10 seconds in a separate thread, I close the connection (in the hope that the ExecuteReader will stop executing). But in the end, the ExecuteReader is waiting for the Command Timeout allocated for it.

Is this considered normal behavior of a synchronous ExecuteReader?
In my scenario, I cannot use the asynchronous API (a lot of legacy code), so my task is to reverse the synchronous operation without waiting for the Command Timeout.
I will be glad to hear advice on which direction to move to solve the problem.

Yoh Deadfall
@YohDeadfall
There is a graceful cancellation of the reader, so it should consume all data before closing the connection. To cancel the running command immediately, use NpgsqlCommand.Cancel which will open a new connection and send a request to stop the current command running on the first connection.
ruslanen
@ruslanen
@YohDeadfall after calling Cancel, it will be similarly expected ExecuteReader (with Command Timeout), and I need to terminate the ExecuteReader immediately
Yoh Deadfall
@YohDeadfall
Which version is used?
ruslanen
@ruslanen
npgsql 4.1.3.1
Shay Rojansky
@roji
@ruslanen to add to what @YohDeadfall wrote, you can indeed trigger PG cancellation (via a separate command) by calling NpgsqlCommand.Cancel. For 5.0 (to be released in two weeks) we've redone the whole cancellation/timeout mechanism to be much better; if the PG cancellation isn't successful after 2 seconds (by default), the socket will be closed and the connection will be broken.
ruslanen
@ruslanen
@roji thanks a lot, I'll try to check with version 5.0
Yousif Touma
@yousiftouma
Hey all, I'm working on updating our project from EFCore 2.2 to 3.1. I updated our data projects to reference EFCore 3.1.9 and the postgres provider 3.1.4. I'm having an issue where webapi projects that reference postgres provider 3.1.4 get the wrong version of Microsoft.EntityFrameworkCore.Relation (3.1.9 is expected due to the data project reference, while 3.1.4 is provided since that is given by the postgres provider which is the only reference in the webapi project). I'm getting a warning about unresolved conflict so it's obvious that I need to fix it, but I'm unsure how. Does it require me to downgrade EFCore to 3.1.4 or do I need to install the higher version of the conflicting dependency in each project that references the postgres provider?
Shay Rojansky
@roji
Patch versions are compatible, so you should just take an explicit dependency on Microsoft.EntityFrameworkCore.Relation 3.1.9 (and any other Microsoft.EntityFrameworkCore packages referenced from the Npgsql provider)
Yousif Touma
@yousiftouma
Thanks, sounds good
Panos Athanasiou
@panoukos41
Hey all, I read that it is more efficient to have multiple schemas than databases. Then I thought that it would be better for me to perform more complex queries in the future. I know you can define a schema using modelBuilder.HasDefaultSchema(schema); and I can set the same value in UseNpgsql with MigrationsHistoryTable. I just want to have these two schemas be the same from configuration but I can't retrieve the configuration inside DbContext. Is there any other way to access the MigrationSchemaTableName inside my modelbuilder?
mm3141
@mm3141
Hi @roji , do you have a plan when to release 4.1.6?
Yousif Touma
@yousiftouma
Is there a way to cast a text column to numeric for an order by or is the only real solution to change the type of the column?
equivalent to order by my_text_column_that_is_numeric::int desc
client side ordering would be too slow
eraffel-MDSol
@eraffel-MDSol
Hey, just trying to plan. When do you expect a 5.0 GA release?
Yoh Deadfall
@YohDeadfall
4.1.6 and 5.0 will be published tomorrow or on Sunday at the same time. All work is mostly done, stay tuned.
eraffel-MDSol
@eraffel-MDSol
thx
Yoh Deadfall
@YohDeadfall
Maybe 4.1.6 will be a bit earlier since it's ready actually and nothing prevents us from publishing it.
So I think will release the patch as soon as wake up and turn the PC (:
nelthaarion
@nelthaarion
hi, when do you release .net5 version !
Yoh Deadfall
@YohDeadfall
Please read the thread carefully, it was answered above.
Shay Rojansky
@roji
@yousiftouma you should be able to use the methods on the Convert class to convert string to int
nelthaarion
@nelthaarion
this countdown will kill me :D
Gosu_Bob
@BoZhu14225250_twitter
Hi Anyone there,i need some help installing this npgsql
For my master study project
Gosu_Bob
@BoZhu14225250_twitter
I successfully install it.Thanks
FerrariF70
@FerrariF70
Hello. I need help. I'm using .NET Framework 4.8 and I want to understand how set up SSL connection. I know that I need write in connection string that parameter SSLMode=Require, but what I need to write in code, that for checking user certificate. Thanks in advance!
Yoh Deadfall
@YohDeadfall
You need to check the server certificate or to use the client certificate? It's very different things.
FerrariF70
@FerrariF70
What do I need for enable to ssl on database? server certificate properly? because server calling to database, or do I need server certificate and client certificate for properly using ssl. I don't know how I need to use. When I connect from client to server for getting data. I get this message: "SSL connection requested. No SSL enabled connection from this host is configured" Because I set my connection string SslMode=Require
Yoh Deadfall
@YohDeadfall
Yes, to use with SSL you have both sides to support it like everywhere else, so you need to setup the server. It's well explained in the documentation for PostgreSQL: https://www.postgresql.org/docs/current/ssl-tcp.html