Skip to main content

Questions tagged [npgsql]

Npgsql is the .NET data provider for PostgreSQL. It allows any program developed for .NET framework to access a PostgreSQL database server. It is implemented in 100% C# code.

Filter by
Sorted by
Tagged with
3 votes
0 answers
73 views

I've been using Npgsql, which uses the DbDataSource abstraction. It's really nice since commands created by it do not need explicit connections to be opened by them....
Adam's user avatar
  • 1,246
2 votes
1 answer
101 views

I want to use a json function of PostgreSQL, that is not part of NpgsqlJsonDbFunctionsExtensions ...
ZorgoZ's user avatar
  • 3,796
2 votes
1 answer
131 views

I am encountering a duplicate key value violates unique constraint error in my ASP.NET Core application, and while I understand why it happens, I am unsure about the best practice to handle it using ...
amg63's user avatar
  • 45
1 vote
0 answers
73 views

I've been struggling for two days with a PostgreSQL enum type issue in Entity Framework Core. Despite all my configuration, EF Core keeps trying to send a string (`text`) to an enum column. The ...
Мирон Никитин's user avatar
0 votes
0 answers
85 views

I have a nested entity, defined like this: ...
ZorgoZ's user avatar
  • 3,796
1 vote
1 answer
122 views

I am working with EF Core 6.0 Web APi. Npgsql.EntityFrameworkCore.PostgreSQL 6.0.29 PostgreSQL 16.3 I have database (Postgres) with musical entities and lessons. Lessons related to musical entities by ...
Александр Васильев's user avatar
0 votes
0 answers
52 views

When I ran a scaffold command on my NPGSQL db with the typical default format I find on the web: ...
Trant's user avatar
  • 3,661
1 vote
0 answers
40 views

I have an Azure Postgres flexible server sitting in a VNet divided into multiple subnets. In a distinct subnet lies an azure app service I am trying to run by publishing it via gitlab. However shortly ...
nicolitre's user avatar
0 votes
1 answer
111 views

I'm using Hilo with a custom sequence name. When creating migrations, EF Core always creates a migration to drop the sequence with the normal name. Since EF Core 9.0, this produces a runtime exception ...
Merijn's user avatar
  • 751
0 votes
1 answer
270 views

I've written a BaseEntity class which defines common fields in my database. It looks something like this: ...
thran's user avatar
  • 186
0 votes
0 answers
83 views

I'm creating in VisualStudio for Application 2022 an ETL that is migrating data from a MS-SQL Server table to another in PostgreSQL DataBase. I create the ADO.NET Destination connection (server IP, ...
Honorius's user avatar
1 vote
1 answer
112 views

I attempt to call two functions to retrieve data from a Postgres database like so: SomeClass.cs ...
aleclouisgrant's user avatar
1 vote
0 answers
103 views

The code documentation for DatabaseFacade.AutoSavepointsEnabled warns that: Setting this value to false should only be done ...
DVN237294's user avatar
0 votes
1 answer
61 views

We are using EF Core 8.0 with the Npgsql provider. We have several entities that look similar to this: ...
Sebastian Weber's user avatar
1 vote
1 answer
130 views

I've got a table with the filed string Data { get; set; } of type jsonb: ...
Hille's user avatar
  • 2,359
0 votes
1 answer
244 views

I'm using Entity Framework Core 9 with PostgreSQL via Npgsql, and I frequently write the following query pattern to perform accent-insensitive and case-insensitive searches: ...
Max Bündchen's user avatar
0 votes
0 answers
196 views

I'm building a .NET Aspire-based application using PostgreSQL with Entity Framework Core. I’m registering my DbContext like this as I am using ...
geothachankary's user avatar
0 votes
0 answers
388 views

I am trying to connect to Postgres 17 in my local machine yet i'm getting an error of "No such host is known". I established a connection to the instance through DBeaver yet doing so in code ...
X HOxha's user avatar
  • 177
0 votes
1 answer
139 views

Reading multiple values from a Postgres database using npgsql and EF Core in an ASP.NET Core MVC view: ...
Andrus's user avatar
  • 28.3k
1 vote
2 answers
67 views

I have prepared a DB fiddle for my questions and also list my SQL code below. I have created a countries_boundaries table, which I intend to fill with .poly files ...
Alexander Farber's user avatar
0 votes
0 answers
85 views

I'm trying to follow the npgsql guide to map a class to a JSON column, but I cannot get past the following error: System.InvalidOperationException: The entity type 'MainCategory' is not mapped to a ...
Camilo Terevinto's user avatar
0 votes
0 answers
74 views

Replication events are displayed by ASP.NET Core 9 MVC controller according using code: ...
Andrus's user avatar
  • 28.3k
0 votes
1 answer
74 views

I have a case where I first want to run a direct query (using .Database.SqlQuery) to try to obtain an advisory lock. Then run another query using linq. When I run ...
Magnus's user avatar
  • 83
0 votes
0 answers
63 views

Postgres 14 hot standby server server is running in Debian Linux under WSL. It saves wal log from master to pg_wal directory. ...
Andrus's user avatar
  • 28.3k
1 vote
0 answers
58 views

I have a DB entity with a JSONB column, modelled as an owned entity with .ToJson(), as recommended by the Npgsql EF Core documentation. ...
Christian Klauser's user avatar
0 votes
1 answer
76 views

I'd like to execute a specific SQL command each time after the connection to the database was successful using Entity Framework Core 9 with the Npgsql Entity Framework Core Provider. More specifically,...
belidzs's user avatar
  • 154
0 votes
0 answers
96 views

I have a base class called BaseDbContext. I derived two classes from this: WriteDbContext and ...
Vivek's user avatar
  • 39
3 votes
0 answers
307 views

I have a bunch of enums in my Postgres database, and for now I always parsed the enums manually from string to the effective value inside my .NET code (first map to string and then convert). While ...
kevingoos's user avatar
  • 4,528
1 vote
0 answers
75 views

I am trying to call a PostgreSQL stored procedure with OUT parameters from my .NET Core 3.1 API to delete a record based on an ID. However, when I attempt to execute the stored procedure with OUT ...
yaminisai's user avatar
0 votes
1 answer
118 views

I'm working with Npgsql and and Dapper I have some tables in PostgreSql with a composite data type: ...
Yván Ecarri's user avatar
  • 1,760
6 votes
1 answer
875 views

I am currently working on a database table, that shall contain some base properties of the data and one property that is a jsonb column in the database that can contain different objects that are ...
Octoate's user avatar
  • 539
0 votes
0 answers
67 views

I'm building an application, using .NET (8), EF Core (8) and Postgres (16). I use nodaTime for every date or time related task and NodaTime.Periods are stored in pg ...
Joshit's user avatar
  • 1,347
0 votes
0 answers
58 views

We are using a single database with a shared schema multi-tenancy model, as it is the most practical way to support a large number of tenants. Is there a recommended pattern or approach in Npgsql to ...
Neeraj's user avatar
  • 1
0 votes
0 answers
77 views

My program in C# using Entity Framework Core I can point to a PostgreSQL or SQLite database. When pointed to PostgreSQL the Database tool of Performance Analyzer does not work. There only appear ...
Zachary Mollohan's user avatar
0 votes
0 answers
64 views

We're using Hot Chocolate 14. .Net + EF Core 8, and PostgreSQL 13... I'd like to build a custom sort convention... but I haven't found any examples after scouring the internet. The first example is ...
aKillaBlitz's user avatar
0 votes
1 answer
180 views

We have an existing Database First (e.g. Scaffolded) .Net 6 project attached to PostgreSQL 13 DB. The DB has a lot of timestamptz aka TIMESTAMP WITH TIMEZONE fields. So we use NodaTime. Time(!) came ...
aKillaBlitz's user avatar
0 votes
1 answer
87 views

I am using the following code with npgsql 9.0.2 inside a .net 8 web api to insert records into a table, but I am having some trouble where my database gets completely overloaded with the CPU hovering ...
Paul's user avatar
  • 119
1 vote
0 answers
128 views

I am struggling to get documents expiring in less than 90 days: ...
acmoune's user avatar
  • 3,473
0 votes
0 answers
35 views

Been fighting with this for some time. Normally got around this running a local copy of my database on my local machine to get around all of the Google/SSL insanity. Burned myself on at least one ...
Shane Brodie's user avatar
1 vote
0 answers
42 views

I have the following PostgreSQL "function1" function1(par1 Enum_1), function1(par1 integer), ... function1(par1 text) In Npgsql V 3.2.7, the parameters ...
Ruebezaehler's user avatar
2 votes
0 answers
97 views

I have an ASP.NET Core Web API using EF Core. I'm trying to implement timeout middleware as shown here: ...
radoll's user avatar
  • 21
0 votes
1 answer
138 views

I am trying to create a stpored procedure via Npsql from C# ...
Kiko's user avatar
  • 357
0 votes
1 answer
101 views

I have been exploring how to access Postgres from C#. When using prepared statements ( which I almost always want to do) the website recommends the following: Create a connection the db ...
John Chenault's user avatar
0 votes
1 answer
80 views

Passing tstzrange to postgres in EF Core using ...
Andrus's user avatar
  • 28.3k
-1 votes
2 answers
172 views

I'm using PostgreSQL with a .NET project, and I'm facing an issue executing a stored procedure through Dapper when using dynamic parameters to pass a DATE parameter....
Hemanth Kumar Chilamkurthi's user avatar
0 votes
0 answers
137 views

I have an ASP.NET Core 8 MVC application. In production the application throws an error Npgsql.PostgresException (0x80004005): 08P01: no more connections allowed (max_client_conn) I am using NPGSQL ...
entity hassle's user avatar
0 votes
1 answer
189 views

I'd like to make a Version-backed column in the database and order by it in queries, keeping the ordering consistent with what would be the result if run on the ...
ZzZombo's user avatar
  • 947
0 votes
0 answers
50 views

My project uses .NET Framework 4.0. During the execution of a program for a certain operation, a message appears in the debugging console: An exception was raised: "System.IO.IOException" in ...
Twinkles's user avatar

1
2 3 4 5
44